The MySQL Server Is Offline – MariaDB cPanel PHP 7.2
Updating MariaDB v10.2.35 or v10.3.26 on cPanel servers can cause the cPanel interface to show MySQL as offline “MySQL Server Is Offline”. This prevents users from adding or managing new databases but existing databases usually function. cPanel has an active case open about this under CPANEL-34745 but this article contains a workaround for users experiencing this issue.
cPanel have released a fix for this issue in the form of a script. You can run the script from the command line as the root user and that should resolve the problem. If it doesnt you can downgrade MariaDB. Here we will cover both solutions.
Run the cPanel auto repair script
As the root user access the command line on the server that is experiencing the issue. The command to run is;
After, restart the MySQL server using the cPanel provided script;
The issue should now be resolved. If not you can try to downgrade MySQL using yum.
Downgrade MySQL using yum
When you update services via yum you can also downgrade again if any issues have been seen. This is useful in cases where updates contain errors. You use the yum downgrade option to downgrade services back to the previous version. To downgrade MariaDB issue the command;
yum -y downgrade MariaDB-common MariaDB-client MariaDB-shared MariaDB-compat MariaDB-devel MariaDB-server
After downgrading you can use yum to lock that version in place so future updates won’t update to the problem version. To lock to a version you can use version lock.
yum install -y yum-plugin-versionlock && yum versionlock MariaDB-*
To see what versions of the software are locked and being prevented from updating use versionlock list;
yum versionlock list
Finally, you can clear all locks to allow updating by issuing the clear command;
yum versionlock clear
How was this article? – The MySQL Server Is Offline – MariaDB cPanel
You might also like
More from cPanel
How To Install Imunify360 cPanel & DirectAdmin ServersImunify360 is a fantastic tool to have in your server toolkit. It's a …
It's possible to repair MySQL databases from WHM and cPanel. You can also mass repair MySQL databases from the command …