On Linux servers running Plesk Panel, outdated versions of MariaDB (such as 5.5) may cause security vulnerabilities and performance issues due to lack of support for modern features.
Therefore, it’s strongly recommended to upgrade to a newer and more stable version like MariaDB 10.6.
This guide explains step-by-step how to upgrade MariaDB on CentOS 8, AlmaLinux 8, and AlmaLinux 9 systems with Plesk.
Before starting, it’s highly recommended to take a full backup.
Then add the following lines:
For AlmaLinux 9:
For CentOS 8:
Then upgrade MariaDB:
Then restart MariaDB:
Therefore, it’s strongly recommended to upgrade to a newer and more stable version like MariaDB 10.6.
This guide explains step-by-step how to upgrade MariaDB on CentOS 8, AlmaLinux 8, and AlmaLinux 9 systems with Plesk.
Before starting, it’s highly recommended to take a full backup.
⚠️ Warning: Always perform a full backup before proceeding to prevent data loss.
Note: MariaDB 10.4 and above are supported on Plesk Obsidian 18.0.30 and later.
1. 📂 Back Up All Databases
Run the following command to back up all databases:
Bash:
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin --verbose --all-databases --routines --triggers > /tmp/all-databases.sql
⚠️ The SQL backup will be saved asall-databases.sqlin/tmp/all-databases.sql.
2. 🛑 Stop MariaDB Service and Remove Old Packages
After stopping the MariaDB service, remove old MariaDB packages to avoid leftover files. Run the following commands:
Bash:
service mariadb stop
yum remove mariadb-gssapi-server
rpm -e --nodeps `rpm -q --whatprovides mariadb-server`
3. 📦 Add MariaDB 10.6 Repositories
To add the official MariaDB repositories, run:
Bash:
nano /etc/yum.repos.d/MariaDB.repo
Then add the following lines:
Bash:
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.6/almalinux8-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
priority=1
module_hotfixes=1
Save and exit:⚠️ The above repository is forAlmaLinux 8. Below are repository examples for other OS versions.
CTRL + X, then Y, then Enter.For AlmaLinux 9:
Bash:
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.6/almalinux9-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
priority=1
module_hotfixes=1
For CentOS 8:
Bash:
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.6/centos8-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
priority=1
module_hotfixes=1
⚠️ To install a newer version, simply replace10.6with your preferred version in thebaseurl.
Example:baseurl = http://yum.mariadb.org/10.11/almalinux9-amd64
⚠️ For Ubuntu-based systems, a manual MariaDB upgrade is not required, as they already include the latest supported version.
4. 🔄 Upgrade MariaDB
Before upgrading, clear all yum cache by running:
Bash:
yum clean all
Then upgrade MariaDB:
Bash:
yum -y install MariaDB-server galera-4 MariaDB-client MariaDB-shared MariaDB-backup MariaDB-common
5. ⚙️ Update MariaDB Configuration Files
Adjust the configuration for compatibility with the new version:
Bash:
sed -i 's/bind-address = ::ffff:127.0.0.1/bind-address = 127.0.0.1/g' /etc/my.cnf
6. ▶️ Start the MariaDB Service
Bash:
systemctl restart mariadb
7. 🔧 Upgrade Databases
Run the following command to upgrade databases:
Bash:
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mariadb-upgrade -uadmin
Bash:
systemctl restart mariadb
8. 🔄 Update Plesk Packages
Ensure Plesk detects the new MariaDB version correctly by running:
Bash:
plesk bin service_node --update local
plesk sbin packagemng -sdf