Upgrading MariaDB 10.0.x to MariaDB 10.1.x on Centos (yum)

Follow these steps to upgrade your existing MariaDB 10.1.x installation to the latest available 10.1.x release.

0. Prepare for the Upgrade

Important: Ensure the following before proceeding:

- Ensure that no traffic is being sent to the database server.
- Back up all configuration files (e.g., /etc/my.cnf*).
- Back up all databases on the server in case any issues occur during the upgrade process.

Always perform a full backup before starting the upgrade process to avoid data loss.

1. Update the YUM Repository Configuration

Update the repository configuration at /etc/yum.repos.d/MariaDB.repo with the new content. You can generate your config file here: https://downloads.mariadb.org/mariadb/repositories/

Old configuration example:

[MariaDB]
gpgcheck=1
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
name=MariaDB 10.0 CentOS repository list - created 2015-02-06 13:47 UTC
humanname=MariaDB 10.0 CentOS repository list - created 2015-02-06 13:47 UTC
baseurl=https://yum.mariadb.org/10.0/centos6-amd64

Replace it with the new configuration:

[mariadb]
name = MariaDB
baseurl = https://yum.mariadb.org/10.1/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

2. Stop the MySQL Service

service mysql stop

3. Update MariaDB Installation Files

yum update

If the update fails with a message like the following example, you will need to install MariaDB manually:

******************************************************************
A MySQL or MariaDB server package (MariaDB-server-10.0.21-1.el6.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 <package-name>' 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. Important details
can be found in the MariaDB manual, in the Upgrading section.
******************************************************************
error: %pre(MariaDB-server-10.1.8-1.el6.x86_64) scriptlet failed, exit status 1

Error in PREIN scriptlet in rpm package MariaDB-server-10.1.8-1.el6.x86_64
error:  install: %pre scriptlet failed (2), skipping MariaDB-server-10.1.8-1.el6
  Verifying  : MariaDB-server-10.1.8-1.el6.x86_64                                      MariaDB-server-10.0.21-1.el6.x86_64 was supposed to be removed but is not!

  Verifying  : MariaDB-server-10.0.21-1.el6.x86_64                                     Failed:
  MariaDB-server.x86_64 0:10.0.21-1.el6            MariaDB-server.x86_64 0:10.1.8-1.el6            Complete!

If you encounter issues during the upgrade, always consult the official MariaDB documentation for troubleshooting steps.

Identify all MariaDB packages:

rpm -qa | grep -i '^MariaDB'

Remove MariaDB packages:

yum remove MariaDB-server

Install the MariaDB server:

yum install MariaDB-server

Update the configuration files in the /etc/my.cnf.d/ directory. Some files may be overwritten during the installation of the new MariaDB version.

Double-check all configuration changes before starting the database server.

4. Start the MySQL Service

service mysql start

5. Run the MySQL Upgrade

The upgrade process may take some time to complete (involving six steps), especially if there are hundreds of databases and tables on your server. Be sure that the MySQL process is running before starting the upgrade.

mysql_upgrade -u root -p

6. Post-Upgrade Steps

- Once the MySQL upgrade is complete, review the MySQL error log to ensure everything is functioning as expected.
- Review your my.cnf file for new configuration settings. The new version includes many new features and configuration options—take advantage of them.

After a successful upgrade, consider testing your applications to ensure compatibility and performance.

×