Upgrade MariaDB Version On AlmaLinux 8 with CWP

  • November 26, 2023

Upgrade Default Installed MariaDB 10.4 To A Newer Version on AlmaLinux 8 With CWP Installed

# denotes the CLI prompt.

Before starting an upgrade please confirm that you have the backup of MySQL databases and users.
Default backup is in the folder /backup/mysql

Also, make sure all your scripts/sites are compatible with the new version as there is no return back to an old version.

It is also a good idea to make an image of the server.

Check which version of MariaDB is installed on your server:

# rpm -qa|grep -i maria

MariaDB Repository Changes

Goto: https://mariadb.org/download/?t=repo-config&d=Red+Hat+Enterprise+Linux+8
Select the version and Country you want.
(In the example below, we use our mirror in England for 10.11.x)

Modify repo file to the version you want to upgrade:

# nano /etc/yum.repos.d/mariadb.repo

Replace all the data with:

name = MariaDB
# rpm.mariadb.org is a dynamic mirror if your preferred mirror goes offline. See https://mariadb.org/mirrorbits/ for details.
# baseurl = https://rpm.mariadb.org/10.11/rhel/$releasever/$basearch
baseurl = https://mariadb.gb.ssimn.org/yum/10.11/rhel/$releasever/$basearch
module_hotfixes = 1
# gpgkey = https://rpm.mariadb.org/RPM-GPG-KEY-MariaDB
gpgkey = https://mariadb.gb.ssimn.org/yum/RPM-GPG-KEY-MariaDB
gpgcheck = 1

Using Nano Editor: Save using Ctrl-O, then Exit using Ctrl-X

Stop and remove the old version of MariaDB (Databases will not be removed)

# service mysql stop
# service mariadb stop
# systemctl disable mariadb
# rpm --nodeps -ev MariaDB-server

Install the new version of MariaDB

# dnf clean all
# dnf update "MariaDB-*" -y
# dnf install MariaDB-server -y
# systemctl enable mariadb
# service mariadb start
# mysql_upgrade

Verify upgraded packages

# rpm -qa|grep -i maria

The output should look like this (10.4.x should be replaced with your new version)


Congrats, you are ready to go.

KB Article Written: 2023-11-24

Original Wiki Written: 2022-02-15 by CWP

How helpful was this article to you?

Posting has been disabled.