由于CentOS7默认的数据库yum源切换成了MariaDB,需要手动设置yum源才可安装mysql。
1、安装yum源
# rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
2、检测可用的yum源
# yum repolist enabled | grep "mysql.*-community.*"
mysql-connectors-community/x86_64 MySQL Connectors Community
mysql-tools-community/x86_64 MySQL Tools Community
mysql56-community/x86_64 MySQL 5.6 Community Server
3、yum安装mysql
# yum -y install mysql-community-server
4、加入开机启动
# systemctl enable mysqld
5、启动mysqld
# systemctl start mysqld
原文地址:http://jacyliao.blog.51cto.com/9336240/1961176