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
不需要密码登录之后
update mysql.user set authentication_string=PASSWORD('123123') where user='root';
�flush privileges;
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 了