Contents

How To Upgrade MariaDB 10.0. to 10.1 in CentOS 7

21 Jul 2018 1 51  0
How To Upgrade MariaDB 10.0. to 10.1 in CentOS 7
How To Upgrade MariaDB 10.0. to 10.1 in CentOS 7

 

This tutorial will teach you how to upgrade MariaDB 10.0 to 10.1 in CentOS 7 Linux. We’ll begin by editing the repository file and performing a yum update. This might fail to automatically update the MariaDB server package, so we are going to show you how you can manually use the mysql_upgrade script to finish the process.

Upgrade MariaDB

Begin by checking the current version of MariaDB that’s installed.

mysql -V
mysql  Ver 15.1 Distrib 10.0.29-MariaDB, for Linux (x86_64) using readline 5.1

 

As you can see, we are running MariaDB 10.0.29. This was installed from a repository that we made a bit ago, as shown below:

cat /etc/yum.repos.d/mariadb.repo
# MariaDB 10.0 CentOS repository list - created 2015-05-01 13:50 UTC

[mariadb]

name = MariaDB

baseurl = https://yum.mariadb.org/10.0/centos7-amd64

gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB

gpgcheck=1

Now just modify the .repo file that you’ve been using for MariaDB with your favourite text editor and change 10.0 to 1.0.1. In this case, the baseurl line will look like the one below after editing.

baseurl = https://yum.mariadb.org/10.1/centos7-amd64

Now you need to upgrade MariaDB by executing the ‘yum update’ command. If this doesn’t provide updates to your MariaDB packages, execute ‘yum clean all’ then try again.

On our server, this began updating the MariaDB-client, MariaDB-common, MariaDB-server, and MariaDB-shared packages to the 10.1.21 versions.

All packages were successfully updated except for MariaDB-server, which failed.

Failed:

  MariaDB-server.x86_64 0:10.0.29-1.el7.centos

The following information is then noted afterwards:

******************************************************************

A MySQL or MariaDB server package (MariaDB-server-10.0.29-1.el7.centos.x86_64) is installed.




Upgrading directly from MySQL 10.0 to MariaDB 10.1 may not

be safe in all cases.  A manual dump and restore using mysqldump is

recommended.  It is important to review the MariaDB manual's Upgrading

section for version-specific incompatibilities.




A manual upgrade is required.

– Ensure that you have a complete, working backup of your data and my.cnf  files

– Shut down the MySQL server cleanly

– Remove the existing MySQL packages.  Usually this command will list the packages you should remove:

rpm -qa | grep -i '^mysql-'

 

You may choose to use ‘rpm –nodeps -ev ‘ to remove the package which contains the mysqlclient shared library.  The library will be reinstalled by the MariaDB-shared package.

– Install the new MariaDB packages supplied by Monty Program AB

– Ensure that the MariaDB server is started

– Run the ‘mysql_upgrade’ program

 

This is a brief description of the upgrade process. Further important details can be found in the MariaDB manual, in the Upgrading section.

******************************************************************

Manual Update

Basically, we have to finish the procedure manually. This can be done by running the following commands in this order. Note that as recommended, you need to first make a backup of all the databases before continuing:

systemctl stop mysql
yum remove MariaDB-server
yum install MariaDB-server
systemctl start mysql
mysql_upgrade -u root -p

This should stop MariaDB, delete the 10.0 package, install the 10.1 version of the package as per the repository update earlier, initiate MariaDB, and then execute the upgrade script. You’ll have to enter the password for the user specified when running the upgrade.

The upgrade took around 15 seconds to finish for about 8 databases that were less than 300 MB in total. Since the contents were checked for compatibility, note that the time for this part could vary depending on your databases.

Now, if we verify the version of MariaDB once more, we will be able to see that we successfully upgraded to version 10.1.

mysql -V
mysql  Ver 15.1 Distrib 10.1.21-MariaDB, for Linux (x86_64) using readline 5.1

Summary

We’ve now shown you how to upgrade MariaDB 10.0 to 10.1. After updating the repository and running ‘yum update’, we need to perform some additional manual steps as shown to complete the upgrade process.

 

0 Comments
Add a comment

Leave a Reply