1. 编辑/etc/yum.repos.d/mysql-community.repo,启用要安装的版本,enable为1代表启用。
# Enable to use MySQL 5.5
[mysql55-community]
name=MySQL 5.5 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.5-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
2. 安装MySQL官方yum源
yum -y install http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm
3.启动mysql服务
servie mysqld start/stop/restart