centos6.x默认安装mysql5.7

centos6.x默认安装mysql5.7_第1张图片


centos6.x默认安装mysql5.7_第2张图片


1. yum 安装 mysql5.7 yum 源

yum localinstall  mysql57-community-release-el6-8.noarch.rpm


2. 查看是否成功安装MySQL Yum Repository

yum repolist enabled|grep ""mysql.*-community.*


3. 安装mysql

yum install mysql-community-server

4.开启数据库服务

service mysqld start


centos6.x默认安装mysql5.7_第3张图片



不需要密码登录之后 

update mysql.user set authentication_string=PASSWORD('123123') where user='root';

�flush privileges;



centos6.x默认安装mysql5.7_第4张图片





5. 授权用户 


centos6.x默认安装mysql5.7_第5张图片

报错之后 通过 通过下面的命令修改密码

ALTER USER USER() IDENTIFIED BY '123123';


修改之后 再进行授权


GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123123' WITH GRANT OPTION;


如果 不行 授权就用 


use mysql;

update user set host='%' where user = 'root' and host!='localhost' ;


然后就 ok 了

你可能感兴趣的:(centos6.x默认安装mysql5.7)