1.wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
2.yum -y localinstall mysql57-community-release-el7-8.noarch.rpm
3.yum -y install mysql-community-server
4.systemctl start mysqld //启动mysql
5.cat /var/log/mysqld.log | grep password //查看密码
6.mysql -uroot -p密码 //如mysql -uroot -p123456
7.set global validate_password_policy=LOW; //设置密码强度为low,如果不设置简单字符串不被允许
8. ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '密码'; //修改密码
9.create user 'root'@'%' identified with mysql_native_password by '密码'; //以下命令是允许远端登录
10.grant all privileges on *.* to 'root'@'%' with grant option;
11.flush privileges;
允许开机自启
systemctl enable mysqld
systemctl daemon-reload