首先进入mysql官网,点击MySQL Server:
选择:Installing and Upgrading MySQL->Installing MySQL on Linux->Installing MySQL on Linux Using RPM Packages from Oracle:
然后下载rpm包,解压如下,标红的就是:
然后执行命令:sudo yum install mysql-community-{client,common,libs}-* mysql-5.*
server的要后面执行,否则会报错,然后执行如下命令:yum -y install mysql-community-server-5.7.19-1.el7.x86_64.rpm,即可安装成功。