Update CentOS 7's MariaDB to MySQL Community 5.6 or 5.7
MariaDB is a perfect replacement for MySQL, but maybe you need "MySQL Community" in your server for any reason. In that case, you can use MySQL Community repository to upgrade from MariaDB to MySQL 5.6 or 5.7:
root@server # wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm root@server # rpm -i mysql57-community-*.rpm
Now, edit /etc/yum.repos.d/mysql-community.repo and enable the desired repository:
# cat /etc/yum.repos.d/mysql-community.repo name=MySQL Connectors Community baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/7/$basearch/ enabled=1 gpgcheck=1 gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql [mysql-tools-community] name=MySQL Tools Community baseurl=http://repo.mysql.com/yum/mysql-tools-community/el/7/$basearch/ enabled=1 gpgcheck=1 gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql # 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/7/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql # Enable to use MySQL 5.6 [mysql56-community] name=MySQL 5.6 Community Server baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/7/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql # Note: MySQL 5.7 is currently in development. For use at your own risk. [mysql57-community-dmr] name=MySQL 5.7 Community Server Development Milestone Release baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/ enabled=1 gpgcheck=1 gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
(Please note the enabled=1
in [mysql57-community-dmr]).
As of Jul-2016, MySQL 5.6 is considered stable and 5.7 in development, so choose the desired version according to your needs.
Now, upgrade the packages:
root@server # yum update
And upgrade the "MySQL system tables" to 5.7:
root@server # mysql_upgrade -u root -p root@server # systemctl restart mysqld
(It might be possible that you need to adjust /etc/my.cnf
for new parameters or parameters whose name changed).
Enjoy your new MySQL!