/
/
Updating MariaDB on AlmaLinux

Updating MariaDB on AlmaLinux

Disclaimer

This article is for informational purposes only. The update involves connecting to a third-party repository and updating the DBMS with critical changes. Ispmanager assumes no liability for any database server malfunctions due to incorrect actions, unsupported server configuration, or incorrect packages in this repository.

Before updating, backups of the panel administrator, panel users, and their databases must be configured and successfully created in the panel.

This update only supports MariaDB versions 10.X to MariaDB 11.4, and only in the default configuration on AlmaLinux 8 and 9.

When updating the DBMS according to these instructions, you must understand all the steps and accept full responsibility! To ensure continued support for the panel and its functionality, we recommend staying on the default DBMS version from the OS vendor.

We also highly recommend that you consult the official MariaDB documentation for the specified versions before updating to verify compatibility between directives, their values, and database data parameters.

Do not use any MySQL server mode: the sql-mode directive should be left blank or removed from the DBMS configuration file entirely. This is necessary to ensure compatibility with legacy database data types.

Preparation

During the database server update, the control panel, websites, and applications that use this database server will be unavailable. Choose a time with minimal server load for the update, and notify your users!

Make sure you have at least 2 GB of free disk space plus enough space for a full backup of all databases:

df -h /

Make sure you have at least 2 GB of free RAM:

free -mh

Update all system packages:

dnf update

Disable monitoring of the mariadb service in the Services section of the control panel using the Monitoring button.

Stop the ispmanager 6 control panel:

/usr/local/mgr5/sbin/mgrctl -m core --lock

To verify that the control panel processes have stopped, run the following commmand, the output must be empty:

ps aux | grep -i "bin/core ispmgr" | grep -v grep

Copy the DBMS root password from /root/.my.cnf and create a backup (dump) of all native DBMS databases:

mysqldump -u root -p<password> --all-databases --single-transaction --quick --lock-tables=false > full-backup-$(date +%F).sql

Check for the line "Dump completed" in the dump, it indicates successful dump creation:

tail <dump_name>

A successfully created dump is critical to ensuring the safety of all data in the database, we highly recommend not to proceed with the update if the dump was not created correctly!

If you need to start the panel after stopping it earlier, see the Start and verification section.

Update

Stop the MariaDB service:

systemctl stop mysqld

Disable the mariadb and mysql modules from AppStream:

dnf module disable mariadb -y
dnf module disable mysql -y

Generate a repository mirror on the official MariaDB website:

  • Open the MariaDB Server Repositories tab
  • Select the Red Hat Enterprise Linux distribution X, where X is your operating system version number
  • Select MariaDB 11.4
  • Select the closest mirror

Connect the repository of the new MariaDB version by pasting the generated contents between the EOF commands, for example:

tee /etc/yum.repos.d/MariaDB.repo << EOF
[mariadb]
name = MariaDB
baseurl = https://rpm.mariadb.org/11.4/rhel/\$releasever/\$basearch
module_hotfixes=1
gpgkey=https://rpm.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
enabled=1
EOF

Enable the repository with dependencies:

tee /etc/yum.repos.d/mysql-community.repo << EOF
[mysql-8.4-lts-community]
name=MySQL 8.4 LTS Community Server
baseurl=http://repo.mysql.com/yum/mysql-8.4-community/el/\$releasever/\$basearch/
enabled=1
gpgcheck=1
gpgkey=https://repo.mysql.com/RPM-GPG-KEY-mysql-2025
EOF

The GPG key link may change. Check the current key file directly in the repository.

Clear and rebuild the package cache:

dnf clean all
dnf makecache

Remove old MariaDB packages:

rpm -e mariadb-server mariadb-common mariadb mariadb-backup mariadb-errmsg mariadb-gssapi-server mariadb-server-utils mariadb-connector-c mariadb-connector-c-config --nodeps

Install packages for the new version of MariaDB:

dnf install MariaDB-server MariaDB-client

Start and verification

Check the configuration file for errors:

mariadbd --defaults-file='/etc/my.cnf.d/mariadb-server.cnf.rpmsave' --verbose --help | grep 'ERROR\]'

If there are no errors, restore it to working order:

cp -ar /etc/my.cnf.d/mariadb-server.cnf.rpmsave /etc/my.cnf.d/mariadb-server.cnf

If you are using your own additional configuration files, check, correct, and restore them using the above commands, replacing mariadb-server.cnf.rpmsave and mariadb-server.cnf with the names of your configurations.

Check the MariaDB version:

rpm -qa | grep -iE "(mysql|mariadb)" | grep -i server

Start and check the status of the MariaDB service:

systemctl start mariadb
systemctl status mariadb

If the service fails to start, ensure that the log_error directive is assigned to the log in the configuration file. By default, the log is located at /var/log/mysql/error.log. To see the latest entries, use the command below:

tail -n 50 /var/log/mysql/error.log

Contact ispmanager support team for assistance with database server errors.

If there are no errors, update the database structure:

mariadb-upgrade

Remove the following symbolic links:

rm /lib/systemd/system/mysqld.service /lib/systemd/system/mysql.service /usr/lib/systemd/system/mysqld.service /usr/lib/systemd/system/mysql.service -f; systemctl daemon-reload

Enable autostart for the service:

systemctl enable mariadb

Restart the DBMS service:

systemctl restart mariadb

Set a new path to the executable for the ispmanager 6 panel:

sed -i "s/\/usr\/libexec\/mysqld/\/usr\/sbin\/mariadbd/g" /usr/local/mgr5/etc/ispmgr.conf.d/mysql.conf

Check DBMS authorization:

mariadb -u root -p

Start the panel:

/usr/local/mgr5/sbin/mgrctl -m core --unlock

Go to the Notifications section and delete any notifications about resolving the mariadb service issue, if any.

In the Software configuration section, the MySQL DBMS server item may be inactive. This is standard panel behavior and is due to manual modification of the native software.

Post-update steps

  • Sites running PHP-FPM may display a 404 error. This is due to the lack of support for user-friendly URLs. You can enable friendly URL support in the settings for each specific site in the Sites section.
  • In AlmaLinux 8, for phpMyAdmin to function correctly, follow the instructions to update the system PHP to version 7.4, as the native version 7.2 does not support the caching_sha2_password plugin, and phpMyAdmin will not be able to authenticate to the new database server.
  • Enable mariadb service monitoring in the Services section of the control panel using the Monitoring button.