Recently, we had to upgrade a MariaDB server from version 10.5.4 to 10.5.13. Before to do the upgrade on a production server, I wanted to test it on a personal VM.
But first, I had to find how to install the specific version 10.5.4 of MariaDB. Today, I’m going to explain how to install a specific version of MariaDB and how to upgrade it to an other specific version.

I’ll now explain how to install MariaDB server version 10.5.4. The first step is to download the MariaDB script to configure access to their MariaDB Package Repositories :

wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup

Note that you can add some parameters when you pull the file, like –mariadb-server-version=<version> that will override the default MariaDB Server version.
Example :

curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version="mariadb-10.6"

Then don’t forget to give the execution right to the script you just downloaded.

chmod +x mariadb_repo_setup

If you didn’t mention the MariaDB version when downloading the script, now is the time to change it to choose the MariaDB version you want to install. You can find all the different packages available here at MariaDB repository configuration tool : https://downloads.mariadb.org/

Use this command to edit the script :

./mariadb_repo_setup --mariadb-server-version="mariadb-10.5.4"

You can now install the MariaDB server. I used yum install as I was working on a Redhat VM.

sudo yum install mariadb-server mariadb-backup

After the installation, have a look if it was properly installed (by listing all the installed package) and if the mysql service is running. If it’s not running, try to start it.

apt list --installed|grep-i mariadb
systemctl status mysql
systemctl start mysql

You can also try to connect to MariaDB server to check its version.

mysql

mysql command

Now, let’s see how to upgrade the version of an installed MariaDB server.

First, you have to remove all the packages concerning MariaDB.

yum remove "mariadb-*"

Then you simply have to repeat the steps that we’ve seen above.

./mariadb_repo_setup --mariadb-server-version="mariadb-10.5.13"
yum install -y mariadb-server mariadb-backup
systemctl status mysql
systemctl start mysql
mysql

You can find all the information on MariaDB Package Repository Setup and Usage at the following link :
https://mariadb.com/kb/en/mariadb-package-repository-setup-and-usage