1. cd /home 下载mysql源安装包
wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
2.安装mysql源
yum localinstall mysql80-community-release-el7-3.noarch.rpm
3.检查是否安装成功
yum repolist enabled | grep "mysql.*-community.*"
4.安装mysql
yum install mysql-community-server
5.启动mysql服务
systemctl start mysqld
6.查看启动状态
systemctl status mysqld
7.设置开机启动
systemctl enable mysqld systemctl daemon-reload