Main Menu

What’s New?

Upgrade from MariaDB 5.5 to 10.1 on CentOS7

Shares

Here is the readout from my current Droplet which is similar to your example:

# cat /etc/redhat-release 
CentOS Linux release 7.1.1503 (Core) 
# mysql -v
Welcome to the MariaDB monitor.  Commands end with ; or g.
Your MariaDB connection id is 2
Server version: 5.5.44-MariaDB MariaDB Server

I’m going to remove MariaDB with this command:

yum remove mariadb mariadb-server

Create /etc/yum.repos.d/MariaDB.repo and place the following contents into it:

# MariaDB 10.1 RedHat repository list - created 2016-02-06 03:30 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/rhel7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

Reinstall MariaDB with this command:

yum install mariadb mariadb-server

(Accept the importing of the RPM-GPG-KEY-MariaDB key with a “Y”)

You’ll want to start MariaDB and make sure it’s enabled to start on boot:

systemctl start mariadb
systemctl enable mariadb.service

IMPORTANT: You can then run mysql_upgrade to update the databases to the new MariaDB version.

And the upgrade is now complete:

# mysql -v
Welcome to the MariaDB monitor.  Commands end with ; or g.
Your MariaDB connection id is 13
Server version: 10.1.11-MariaDB MariaDB Server