zoukankan      html  css  js  c++  java
  • linux(centos) yum 安装 mysql

    //yum

    yum list mysql-server
    yum install mysql-server
    //this godd : yum -y install mysql mysql-server mysql-devel

    //然后一路Y【yes】,安装完成。

    开机启动

    #chkconfig --add mysqld (在服务清单中添加mysql服务)
    #chkconfig mysqld on (设置mysql服务随开机启动)
    #service mysqld start (启动mysql服务)

    //开机起动

    chkconfig mysqld on

    //开启3306端口并保存

    /sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
    /etc/rc.d/init.d/iptables save

    //使用登录数据库

    mysql -h localhost -p123456

    //修改用户名密码(mysql表)

    use mysql;
    update user set password=password('密码') where user='root';
    flush privileges;

    //设置远程访问

    grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;

    //防乱码
    //找一个配置文件,复制到/etc/目录,命名为my.cnf (有时候没有my.cnf)

    cd /etc
    find -iname '*.cnf' -print
    cp /usr/share/doc/mysql-server-5.1.73/my-medium.cnf /etc/my.cnf
    vim my.cnf

    //在[client]和[mysqld]下面都添加上

    default-character-set=utf8

    //保存退出
    esc

    :wq

    //重启mysql

    service mysqld restart

  • 相关阅读:
    无限维
    黎曼流形
    why we need virtual key word
    TOJ 4119 Split Equally
    TOJ 4003 Next Permutation
    TOJ 4002 Palindrome Generator
    TOJ 2749 Absent Substrings
    TOJ 2641 Gene
    TOJ 2861 Octal Fractions
    TOJ 4394 Rebuild Road
  • 原文地址:https://www.cnblogs.com/richardcastle/p/8296720.html
Copyright © 2011-2022 走看看