1.下载mysql的yum源
https://dev.mysql.com/downloads/repo/yum/
2.安装yum源
shell> sudo yum localinstall platform-and-version-specific-package-name.rpm
3.选择mysql版本
shell> yum repolist all | grep mysql
shell> sudo yum-config-manager --disable mysql56-community
shell> sudo yum-config-manager --disable mysql80-community
shell> sudo yum-config-manager --enable mysql57-community
4.查看mysql版本是否正确
shell> yum repolist enabled | grep mysql
5.安装mysql
shell> sudo yum install mysql-community-server
6.启动mysql
shell> sudo service mysqld start
Starting mysqld:[ OK ]