How to Upgrade and Downgrade MariaDB Version in WHM/cPanel – Part 8

By | January 5, 2020

There might be a Scenario that you are running your web application from So long which is pointing to your MariaDB (say Version 10.1.43). Now you planning to migrate your application to your dedicated Server in AWS. Whn you are trying to Install the cPanel It Comes Up with Mysql 5.7 Database which is causing an issue in your application, as your database is compatible with 10.1.43 version of MariaDB. In this Case It’s easy to Install MariaDB Database instead of MySQL in WHM/cPanel for your applications and It is also easy to Upgrade the MariaDB Version but It’s not quite Straight forward to downgrade the MariaDB Version in WHM. This is something which you can not control from the WHM Console.

So in this blog we will See how we can change the cPanel MySQL Version to MariaDB and how to Upgrade and Downgrade the MariaDB Version based on the application requirement.

1.  Change cPanel Database from MySQL to MariaDB.

First of all check the current Version of Database Installed and associated to your cPanel. For this, Login to your WHM Console and Search for Mysql/MariaDB Upgrade. When you click on It, you will be able to see the current version of Database Installed.

You can also check the version of Database from PhpMyadmin. Search and Click on it from cPanel. 

Now to Change database from MySQL to MariaDB again go to WHM Console and Search for Mysql/MariaDB Upgrade. Select MariaDB 10.2 from the List and Click on Next.

Note: Once upgraded to MariaDB you will not be able to see the option of rollback to MySQL again.

Now click the checkbox next to each warning to indicate that you understand the potential consequences of this upgrade and Click on Continue.
Now Select Unattended Upgrade from the Upgrade type and Click on Continue to Upgrade. cPanel will automatically change the database type to MariaDB 10.2 from MySQL. go ahead and verify it once the Upgrade process is completed.

2. Downgrade the Version of MariaDB from 10.2 to 10.1.43 (or any)

Now you have MariaDB Instead of MySQL, but you have some application dependencies and you need to have MariaDB v10.1.43 Instead of 10.2. This downgrade process you won’t be able to do it from the WHM. In order to downgrade, let’s login to the Linux Server and elevate permission to root user.

$ sudo su -

Check the Installed MariaDB Packages.

# yum list installed MariaDB-client MariaDB-common MariaDB-compat MariaDB-devel MariaDB-server MariaDB-shared

Delete all MariaDB 10.2 packages.

# yum remove MariaDB-client MariaDB-common MariaDB-compat MariaDB-devel MariaDB-server MariaDB-shared

Check MariaDB Service. It should not be running.

# sudo service maridb status

Now, move all the MariaDB file to /tmp location.

# mv /var/lib/mysql /tmp

Now if will go to the cPanel Account, your would not be able to see MySQL, PHPMyadmin and Other Mysql Services. All must have dissappeared at this point of time.
Now Let’s add yum repository for MariaDB 10.1.43 Version. For other Version,  get the Yum Repository from the MariaDB Docs here.

# vim /etc/yum.repos.d/MariaDB102.repo

Delete v10.2 base Url and add new repo as shown below.

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

Save and Exit. Now Install all packages of MariaDB again, this time it will be 10.1.43 refering to the repos we have created.

# yum repolist
# yum install MariaDB-client MariaDB-common MariaDB-compat MariaDB-devel MariaDB-server MariaDB-shared

Once packages are installed, go ahead and verify the MariaDB Service status.

# service mariadb status

Wait for few mins, All those Icons will again be visible in cPanel.
Note: All Users, databases, and db dumps will be deleted, you have to create the database and restore it from the dumps.

Verify the MariaDB Version, It should be downgraded to 10.1.43.

If you are facing an Issue Opening PhpMyadmin from cpanel with error “Access Denied” then Just go to your WHM Console, Search for “Mysql root password” and reset Database root password. After this try opening the Phpmyadmin again.

Note: Create database, Users and restore it from the dumps.


If you Like Our Content here at Devopsage, then please support us by sharing this post.

Please Like and follow us at, LinkedInFacebookTwitter, and GitHub

Also, Please comment on the post with your views and let us know if any changes need to be done.
Thanks!


How to Install WordPress on Top of LAMP Stack on Ubuntu and Redhat/CentOS7 Server.

How to Install and Setup WHM and cPanel On CentOS7 – Part 1

Basic WHM Configuration and Hosting a Website in cPanel Account – Part 2

How to Create Email and FTP Account in cPanel – Part3

How to Redirect Primary Domain to a Specific Folder in cPanel.

Issue – cPanel Email Going to Spam.

Unable to Login cPanel FTP with Failed to Retrieve Directory Listing Error

How to Migrate WordPress Website to cPanel – Part 4

How to Migrate Email Accounts from One cPanel to Another – Part 5

How to use an SSL Certificate for your cPanel Website for Free – Part 6

Redirect HTTP to HTTPS for your Website on cPanel – Part 7

cPanel – phpMyAdmin asking for Username and Password. Error – Access Denied.

Leave a Reply

Your email address will not be published. Required fields are marked *