#先下载
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
#安装
yum -y install mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql-community-server
#启动
systemctl start mysqld.service
#开机自起
systemctl enable mysqld
#查看状态
systemctl status mysqld.service
#找到密码
grep "password" /var/log/mysqld.log
#修改密码
mysql -uroot -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
#允许远程访问
grant all privileges on *.* to 'root'@'%' identified by 'password' with grant option;
flush privileges;
exit
#开启防火墙
firewall-cmd --zone=public --add-port=3306/tcp --permanent
firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --reload