1,下载并安装MySQL官方的 Yum Repository
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
2,直接yum安装
yum -y install mysql57-community-release-el7-10.noarch.rpm
3,安装MySQL服务器
yum -y install mysql-community-server
4,启动MySQL服务
systemctl start mysqld.service
5,查看MySql状态
systemctl status mysqld.service
6,查看MySql初始密码
grep "password" /var/log/mysqld.log
7,使用root用户进入Mysql
mysql -u root -p
8,个性密码策略
set global validate_password_policy=0; #密码强度策略设为最低
set global validate_password_length=6; #密码允许最小长度为6
9,设置密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
10,更新授权
flush privileges;
11,开启远程访问
grant all privileges on *.* to 'root'@'%' identified by 'password' with grant option;
12,完成
exit;