Upgrade MariaDB Community Server from 10.5.X to 10.5.Y
This page is part of MariaDB's Documentation.
The parent of this page is: Upgrades for MariaDB Community Server
Topics on this page:
Overview
These instructions detail a minor release upgrade with MariaDB Community Server 10.5 on a range of supported Operating Systems.
A minor release upgrade is a change from an earlier release of MariaDB Community Server 10.5 to a later release in the same release series.
For example, it would be a minor release upgrade to upgrade from MariaDB Community Server 10.5.25 to MariaDB Community Server 10.5.26.
Data Backup
Occasionally, issues can be encountered during upgrades. These issues can even potentially corrupt the database's data files, preventing you from easily reverting to the old installation. Therefore, it is generally best to perform a backup prior to upgrading. If an issue is encountered during the upgrade, you can use the backup to restore your MariaDB Server database to the old version. If the upgrade finishes without issue, then the backup can be deleted.
The instructions below show how to perform a backup using MariaDB Backup. For more information about backing up and restoring the database, please see the Recovery Guide.
Take a full backup.
On MariaDB Community Server 10.4 and later:
$ sudo mariadb-backup --backup \ --user=mariabackup_user \ --password=mariabackup_passwd \ --target-dir=/data/backup/preupgrade_backup
On MariaDB Community Server 10.3 and earlier:
$ sudo mariabackup --backup \ --user=mariabackup_user \ --password=mariabackup_passwd \ --target-dir=/data/backup/preupgrade_backup
Confirm successful completion of the backup operation.
The backup must be prepared.
On MariaDB Community Server 10.4 and later:
$ sudo mariadb-backup --prepare \ --target-dir=/data/backup/preupgrade_backup
On MariaDB Community Server 10.3 and earlier:
$ sudo mariabackup --prepare \ --target-dir=/data/backup/preupgrade_backup
Confirm successful completion of the prepare operation.
Backups should be tested before they are trusted.
Stop the MariaDB Server Process
Before the new version can be installed, we first need to stop the current MariaDB Server process.
Set the innodb_
fast_ system variable toshutdown 1
:SET GLOBAL innodb_fast_shutdown = 1;
Use XA RECOVER to confirm that there are no external XA transactions in a prepared state:
XA RECOVER;
Commit or rollback any open XA transactions before stopping the node for upgrade.
Stop the server process:
For distributions that use systemd (most supported OSes), you can manage the Server process using the
systemctl
command:$ sudo systemctl stop mariadb
Install the New Version
MariaDB Corporation provides package repositories for YUM (RHEL, CentOS, Rocky Linux), APT (Debian, Ubuntu), and ZYpp (SLES).
Install via YUM (RHEL, CentOS, Rocky Linux)
Configure the YUM package repository.
Installable versions of MariaDB Community Server are
10.6
,10.5
,10.4
,10.3
, and10.2
. Prefix the version withmariadb-
and pass the version string to the--mariadb-server-version
flag to mariadb_repo_ . The following directions referencesetup 10.5
.To configure YUM package repositories:
$ sudo yum install curl $ curl -LsSO https://r.mariadb.com/downloads/mariadb_repo_setup $ echo "6083ef1974d11f49d42ae668fb9d513f7dc2c6276ffa47caed488c4b47268593 mariadb_repo_setup" \ | sha256sum -c - $ chmod +x mariadb_repo_setup $ sudo ./mariadb_repo_setup \ --mariadb-server-version="mariadb-10.5"
Update MariaDB Community Server and package dependencies:
$ sudo yum update "MariaDB-*" "galera*"
Install via APT (Debian, Ubuntu)
Configure the APT package repository.
Installable versions of MariaDB Community Server are
10.6
,10.5
,10.4
,10.3
, and10.2
. Prefix the version withmariadb-
and pass the version string to the--mariadb-server-version
flag to mariadb_repo_ . The following directions referencesetup 10.5
.To configure APT package repositories:
$ sudo apt install curl $ curl -LsSO https://r.mariadb.com/downloads/mariadb_repo_setup $ echo "6083ef1974d11f49d42ae668fb9d513f7dc2c6276ffa47caed488c4b47268593 mariadb_repo_setup" \ | sha256sum -c - $ chmod +x mariadb_repo_setup $ sudo ./mariadb_repo_setup \ --mariadb-server-version="mariadb-10.5" $ sudo apt update
Update MariaDB Community Server and package dependencies:
$ sudo apt install --only-upgrade "mariadb-*" "galera*"
Install via ZYpp (SLES)
Configure the ZYpp package repository.
Installable versions of MariaDB Community Server are
10.6
,10.5
,10.4
,10.3
, and10.2
. Prefix the version withmariadb-
and pass the version string to the--mariadb-server-version
flag to mariadb_repo_ . The following directions referencesetup 10.5
.To configure ZYpp package repositories:
$ sudo zypper install curl $ curl -LsSO https://r.mariadb.com/downloads/mariadb_repo_setup $ echo "6083ef1974d11f49d42ae668fb9d513f7dc2c6276ffa47caed488c4b47268593 mariadb_repo_setup" \ | sha256sum -c - $ chmod +x mariadb_repo_setup $ sudo ./mariadb_repo_setup \ --mariadb-server-version="mariadb-10.5"
Update MariaDB Community Server and package dependencies:
$ sudo zypper update "MariaDB-*"
Configuration
For platforms that use YUM or ZYpp as a package manager:
MariaDB Community Server's packages bundle several configuration files:
/etc/my.cnf
/etc/my.cnf.d/client.cnf
/etc/my.cnf.d/mysql-clients.cnf
/etc/my.cnf.d/server.cnf
If your version of any of these configuration files contained any custom edits, then the package manager may save your edited version with the .rpmsave
extension during the upgrade process. If you want to continue using your version with the custom edits, then you may need to move it back. For example, to move server.cnf
back in place:
$ sudo mv /etc/my.cnf.d/server.cnf /etc/my.cnf.d/server.cnf.original
$ sudo mv /etc/my.cnf.d/server.cnf.rpmsave /etc/my.cnf.d/server.cnf
Starting the Server
MariaDB Community Server includes configuration to start, stop, restart, enable/disable on boot, and check the status of the Server using the operating system default process management system.
For distributions that use systemd, you can manage the Server process using the systemctl
command:
Operation | Command |
Start |
|
Stop |
|
Restart |
|
Enable during startup |
|
Disable during startup |
|
Status |
|
Upgrading the Data Directory
MariaDB Community Server ships with a utility that can be used to identify and correct compatibility issues in the new version. After you upgrade your Server and start the server process, run this utility to upgrade the data directory.
The utility is called mariadb-upgrade in MariaDB Community Server 10.4 and later:
$ sudo mariadb-upgrade
And the utility is called mysql_
$ sudo mysql_upgrade
Testing
When MariaDB Community Server is up and running on your system, you should test that it is working and there weren't any issues during startup.
Connect to the server using MariaDB Client using the
root@localhost
user account.MariaDB Client is called mariadb (CS10.5, CS10.4) or mysql (CS10.3, CS10.2):
$ sudo mariadb Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 9 Server version: 10.5.26-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>
The version of the server can be verified by checking the client's initial output.
You can also verify the server version by checking the value of the version system variable with the SHOW GLOBAL STATUS statement:
SHOW GLOBAL VARIABLES LIKE 'version';
+---------------+-----------------+ | Variable_name | Value | +---------------+-----------------+ | version | 10.5.26-MariaDB | +---------------+-----------------+
You can also verify the server version by calling the VERSION() function:
SELECT VERSION();
+-----------------+ | VERSION() | +-----------------+ | 10.5.26-MariaDB | +-----------------+