美文网首页
Centos6.4中mysql 5.7 RPM安装

Centos6.4中mysql 5.7 RPM安装

作者: 会飞的大象 | 来源:发表于2016-12-21 15:39 被阅读616次
    1. MySQL 下载地址:http://dev.mysql.com/downloads/mysql/
      选择版本:centos6 对应红帽的linux6
      Red Hat Enterprise Linux 6 / Oracle Linux 6 (x86, 64-bit), RPM Bundle 5.7.17 448.5M
      Download
      (mysql-5.7.17-1.el6.x86_64.rpm-bundle.tar)

    2. 解压: tar -xvf mysql-5.7.17-1.el6.x86_64.rpm-bundle.tar

    3. 检查是否已安装:rpm -qa | grep mysql

    4. 卸载已安装:rpm -e --nodeps mysql-libs-5.1.73-5.el6_6.x86_64

    5. 安装顺序 :
      rpm -ivh mysql-community-common-5.7.17-1.el6.x86_64.rpm
      rpm -ivh mysql-community-libs-5.7.17-1.el6.x86_64.rpm
      rpm -ivh mysql-community-client-5.7.17-1.el6.x86_64.rpm
      rpm -ivh mysql-community-server-5.7.17-1.el6.x86_64.rpm

    6. 查看默认密码:grep "password" /var/log/mysqld.log

    7. 启动mysqld服务:service mysqld start

    8. 设置mysqld服务默认启动:chkconfig mysqld on

    9. 登陆mysql : mysql -uroot -ppassword(修改成自己的密码)

    10. 修改默认密码:SET PASSWORD FOR 'root'@'localhost' = PASSWORD('root');
      修改字符集:vim /etc/my.cnf ,在[mysqld]下新增一行,添加default-character-set=utf8,保存
      若修改密码报错 error 1819(HY000),则是由于当前的密码验证插件validate_password设置的级别过高。运行以下语句修改安全级别:
      set global validate_password_mixed_case_count=0;
      set global validate_password_number_count=3;
      set global validate_password_special_char_count=0;
      set global validate_password_length=3;
      再修改密码即可

    11. 登陆mysql,查看字符集:show variables like "%character%";

    相关文章

      网友评论

          本文标题:Centos6.4中mysql 5.7 RPM安装

          本文链接:https://www.haomeiwen.com/subject/nnsqvttx.html