MariaDB: version update

In this tutorial, I’ll explain how to perform a “mounted” (10.4 to 10.5) version of MariaDB on a Linux environment (Ubuntu).

Before starting this operation, it is imperative to perform at least a backup of the databases. If the server is backed up, verify the backup.

Small tip if you are in a virtual environment (Hyper-V, VMWare …). Stop the MariaDB service on the server, take a snapshot (checkpoint), restart the service and follow the tutorial below.

1. Edit the /etc/apt/sources.list file and comment or delete the lines related to the installed version of MariaDB and save.

2. Then add the repository of the new version of MariaDB. In order to have the orders to place, go to MariaDB – Setting up MariaDB Repositories – MariaDB.

Example for Ubuntu 20.04 and MariaDB 10.5:

sudo apt-get install software-properties-common
sudo apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'
sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://mariadb.mirrors.ovh.net/MariaDB/repo/10.5/ubuntu focal main'

3. Update the list of packages:

sudo apt update

4. Stop the MariaDB service:

sudo systemctl stop mariadb.service

5. Now, we will uninstall the previous version of MariaDB and normally if all goes well, you will be offered to update to the new version. Enter the command below to uninstall MariaDB and accept the installation of the new version.

sudo apt remove mariadb-server-10.4

6. During installation, wait for the uninstallation and installation of the new version of MariaDB.

7. Once the update is complete, verify proper operation using the command below to check the service status:

sudo service status mariadb.service

8. Last step to finish updating, updating databases, enter the command below:

sudo mysql_upgrade

You now know how to do a MariaDB version update, although this operation is not complicated, it is important to make sure you have a backup of the server and the databases before starting.



Comments are not currently available for this post.