版本:5.6
- 下载yum源文件
wget https://repo.mysql.com//mysql57-community-release-el6-11.noarch.rpm
- 安装yum源
rpm -ivh mysql57-community-release-el6-11.noarch.rpm
- 修改版本信息
vi /etc/yum.repos.d/mysql-community.repo
[mysql56-community]
name=MySQL 5.6 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
- 重建yum cache
yum makecache
- 安装mysql相关app
yum -y install mysql-community-libs-compat mysql-community-common mysql-community-server mysql-community-libs mysql-community-devel mysql-community-client