Update MariaDB versions

Every so often we have updates of MariaDB versions, and it can be interesting to make an update between major versions. How are they carried out?

NOTE: This manual is based specifically on an Ubuntu 20.04 and with the installed version of MariaDB 10.5, with the aim of upgrading to MariaDB 10.6. It should generally work for any Debian/Ubuntu version.

This tutorial has been created on a Clouding.io VPS. You can create your own VPS from 3€/month.

In addition, you have the possibility to create your VPS with the WordPress image in one click.


Before starting, the ideal would be to make a backup of all the configuration files. You can do this in several ways; this is one of them.

cd ~
mkdir mariadb-copia/
cp -R /etc/mysql/mariadb.conf.d/* ~/mariadb-copia/

The first thing we have to do is update the repository. For this we will indicate the new version that in this case will be that of MariaDB 10.6.

curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version="mariadb-10.6" --skip-maxscale

Now that we have established the new version, we are going to temporarily stop the database.

service mariadb stop

Before upgrading or installing the new versions, we will uninstall the database server. The data is not going to be deleted, only the software.

apt -y remove mariadb-server mariadb-client mariadb-backup

Later we will install the new version, as if it were a new program.

apt -y install mariadb-server mariadb-client mariadb-backup

In case of having custom configurations, the safest thing is that they are from the server file. You can recover the configuration and adapt it to the new version by recovering the fcihero. In the previous case we will have the main file in

cat ~/mariadb-copia/50-server.cnf

So we will make the corresponding configuration changes. Once finished, we will start MariaDB again and validate that it is working.

service mariadb start
service mariadb status

To finish, we can force an update and make sure that it has been done correctly.

mysql_upgrade --force

Once the process is finished, we can go to our WordPress and in Site Health validate that we have the new version installed.

And with this we will have the new version of MariaDB working.

About this document

This document is regulated by the EUPL v1.2 license, published in WP SysAdmin and created by Javier Casares. Please, if you use this content in your website, your presentation or any material you distribute, remember to mention this site or its author, and having to put the material you create under EUPL license.