View Single Post


Old
  Post #1 (permalink)   01-13-2019, 11:07 AM
el5olfaa.com
HD Newbie
 
Join Date: Apr 2012
Posts: 10
Send a message via MSN to el5olfaa.com

Status: el5olfaa.com is offline
Hello,

On most cases MariaDB is providing better performance than Mysql while standing with a good compatibility for scripts that made depending on Mysql .

Today i will learn you how to switch to MariaDB on cPanel server and try to fix compatibility issues "if happened" .

Let's follow my instructions :
First we will make a backup of our Mysql files & databases :
1) Go to your WHM panel "Home Service Configuration Service Manager" .

2) Uncheck "MySQL Server" to disable and take it down until we finish our backup .

3) Connect to your server shell and do the following command to make an copy of all mysql files :
Code:
cp -r /var/lib/mysql /var/lib/mysql_backup
4) Go to your WHM panel "Home Service Configuration Service Manager"

5) Check "MySQL Server" again and save .

6) Go back to your server shell and do this command to take dump all databases in one file :
Code:
mysqldump --all-databases --force > /var/lib/mysql_backup/all-databases.sql
Now let's go through the switching instructions :

1) Go to your WHM panel "Home SQL Services MySQL/MariaDB Upgrade"

2) Choose "MariaDB 10.2" from list and click on "Continue" button .

3) Check all boxes and click on "Continue" button .

4) Now you will see tow options to choose between just choose "Interactive Upgrade" to go through upgrading process for any exist database .

5) Click on "Continue" button and wait it to finish .

Remember that MariaDB 10.2.4+ strict mode is enabled by default so if you countered some compatibility issue on insert queries like this :
Code:
Field xxxx has no default value
Connect to your server shell and modify my.cnf by using the following command :
Code:
nano /etc/my.cnf
Then add the following line after "[mysqld]" section :
Code:
sql-mode = "NO_ENGINE_SUBSTITUTION"
Now restart MariaDB server to apply new configuration by using this command :
Code:
service mysql restart
That's all .

Good luck

Last edited by el5olfaa.com : 01-13-2019 at 11:19 AM.