cd /usr/local/src/
wget https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm
rpm -ivh mysql57-community-release-el7-11.noarch.rpmyum install mysql-community-serversystemctl start mysqld.servicesystemctl status mysqld.service// 获取安装的默认密码
grep 'temporary password' /var/log/mysqld.log// 连接MySQL
mysql -uroot -p// 修改默认密码
ALTER USER 'root'@'localhost' IDENTIFIED BY '1@3$qWeR';// 切换数据库
use mysql
// 允许远程连接
update user set host='%' where user='root';
// 查看 user
select host,user,plugin from user;// 修改密码强度策略
// 查看
SHOW VARIABLES like 'validate_password%';
// 修改
set global validate_password_policy=0;
set global validate_password_length=4;
set global validate_password_check_user_name=0;FLUSH PRIVILEGES;// 将密码修改为简单密码
ALTER USER 'root'@'%' IDENTIFIED BY 'root';