Upgrading MariaDB on CentOS 7 is a simple task as it's a drop-in replacement for MySQL, by default CentOS 7 ships with MariaDB 5.5.

In this tutorial I will be running through the upgrade process as the root user with the asumtion this is a new install, this will also be aplicable for exising installs (done this many times on existing servers without any issues).

Before starting the upgrade it's always best to make sure you have a backup of your databases and you have run all system updates.

Install all recent updates and packages

yum update -y 

Over the next few step you are going to add the repo for MariaDB, remove the old version and install the new 10.x release.

Add the repo

Here I am going to add the repo for 10.2 (latest stable). navigate to mariaDB repo page https://downloads.mariadb.org/mariadb/repositories/ and select the your Disto, Release and Version you want, this will then list the details for the repo, create your repo file

vi  /etc/yum.repos.d/MariaDB.repo

and then past in the details provided

# MariaDB 10.2 CentOS repository list - created 2018-04-30 19:32 UTC
# http://downloads.mariadb.org/mariadb/repositories/
name = MariaDB
baseurl = http://yum.mariadb.org/10.2/centos7-amd64

Remove MariaDB 5.5

Be sure to backup MariaDB and/or your entire server before proceeding with the following instructions! Removing MariaDB will remove services that depend on MariaDB! Stop MariaDB:

systemctl stop mariadb

Remove MariaDB packages and clean up repo cache

yum remove mariadb-server mariadb mariadb-libs
yum clean all

Install MariaDB 10.x

If all has gone smothly which it should have then you are ready to install MariaDB 10.x

yum install MariaDB-server MariaDB-client -y

Start MariaDB

systemctl start mariadb

Set to start at boot

systemctl enable mariadb

upgrade your mysql databases

mysql_upgrade -p

Check that MariaDB is running and you can login and view your databases.

mysql -p
show databases;

And that it you have now upgraded to MariaDB 10.x hope this has helped you with your upgrade.

Add a comment

0.0(0 votes)

Next Post Previous Post