1.下载MySQL官方的 Yum Repositorywget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
2.yum 安装MySQL官方的 Yum Repositoryyum -y install mysql57-community-release-el7-10.noarch.rpm
3.安装MySQL服务器yum -y install mysql-community-server
4.启动mysqlsystemctl start mysqld.service
5.查看 mysql 是否安装成功
ps -ef | grep mysql
mysqladmin --version
6.启动mysql,设置开机自启,查看mysql状态
systemctl start mysqld
systemctl enable mysqld
systemctl status mysqld
7.在日志文件中找到root密码grep "password" /var/log/mysqld.log
8.登录mysqlmysql -uroot -p
9.修改MySQL默认密码, 密码设置必须要大小写字母数字和特殊符号(,/';:等)alter user 'root'@'localhost' identified by 'Root123,';
10.开启远程访问限制grant all privileges on *.* to 'root'@'%' identified by 'Root123,' with grant option;
flush privileges;
exit
11.开启安全组权限,远程连接测试