Upgrade MySQL to MariaDB on a cPanel server
Need professional assistance ? Checkout our cPanel Server Management plan, only $75 per month including 24×7 monitoring.
IMPORTANT: Take a full backup of your individual database and copy of /var/lib/mysql before taking backup. Make sure to stop mysql before taking backup of /var/lib/mysql
On a production servers every want to keep most uptodate software so that you can avoid the mess of upgrading packages later and avoid downtime on live websites. Default cPanel comes with MySQL 5.6 and it will become end of life on February 28, 2018 so i highly recommend to upgrade it to MariaDB 10.2 MariaDB 10.1 or MariaDB 10.0 MariaDB 10.2 is the latest version so here we are going to Upgrade MySQL to MariaDB on a cPanel server. If you already have database on the server take a copy of /var/lib/mysql and dump of all databases. You can use this using below commands.
cp -rvf /var/lib/mysql /var/lib/mysql_backup
And take dump of all database using
mysqldump --all-databases > all-databases.sql
If you want to take individual backup of the database run the command
for i in `echo "show databases;" | mysql | grep -v Database` do mysqldump $i > "/home/mysqlbackup/$I.sql" done
This will create backup of database individually under /home/mysqlbackup/ make sure to create the directory before running the script.
Upgrade MySQL to MariaDB on a cPanel server
Now we will start MySQL upgrade from Home »Software »MySQL/MariaDB Upgrade
Step 1
Here current version is

Upgrade mysql to mariadb on cpanel server from whm interface.
Step 2
On step 2 WHM will show couple of warning you need to tick all of them to go to next step.
Please click the checkbox next to each warning to indicate that you understand the potential consequences of this upgrade.
System Specific Warnings | ||
---|---|---|
Severity | Message | |
General Warnings | ||
---|---|---|
Severity | Message | |
|
Step 3
On the step 3 it will ask you if you want
When you click next WHM will start MySQL upgrade.
In some cases Innodb will during the upgrade in that case you need to recover innodb manually or restore the backup we have taken,
Once the restoration completes it will show “MariaDB upgrade completed successfully” we have completed Upgrade MySQL to MariaDB on a cPanel server
Once everything is done you can verify new MariaDB installation using the below command
[root@server ~]# mysql Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 49 Server version: 10.2.13-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)]>
If you can see below output everything is done and MariaDB is working fine.
Need help with cPanel server management ? Check our cPanel server management plan
Nice Post. This is for the whole Server. Is it possible to upgrade MySQL to MariaDB for a Particular Account? Such as all domains in a Single cPanel account will have MariaDB and another cPanel accounts run MySQL 5.6 only?
That is not possible, you can install mariadb on a remote server and configure the server to connect to it.
Thanks for the article but what if other applications breaks. Can I downgrade again to MySQL 5.6?
You can reinstall MySQL with the required MySQL version. Make sure to backup your MySQL database before doing so. It is not recommended on production servers.
I am getting this error on WHM
Unsupported MySQL Version
This server currently uses a version of MySQL® (5.5) that cPanel, L.L.C., does not support and that will not function in future versions of cPanel & WHM. Update MySQL to ensure that you receive the latest features and security fixes.
To upgrade your MySQL version, use the MySQL/MariaDB Upgrade interface.
Should i upgrade to get rid of this warning ?
Yes you need to upgrade MySQL to latest version of Mariadb or MySQL to get rid of the error in whm/cPanel