How do I upgrade from MariaDB 5.5 to 10.1 on CentOS7

I set up a CentOS7 LAMP server a couple of months ago, and installed MariaDB with sudo yum install mariadb-server mariadb. It seemed to default to MariaDB 5.5. But I’d like to upgrade to 10.1 - unless anyone thinks there is any reason this is not a good idea?

What is the easiest and safest way to do this?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Thank you. Beautiful, simple, very helpful guide.

Hey there,

It’s fairly painless. Prior to doing anything I’d recommend exporting your databases as backups and if this is a DigitalOcean Droplet, I’d recommend creating a snapshot.

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
name = MariaDB
baseurl =

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

Happy coding,

Jon Schwenn Platform Support Specialist DigitalOcean