How to MySQL version downgrade (from 5.1 to 4.0) in a cPanel server.
We can easily Upgrade MySQL version from WHM: Main >> Software >> MySQL Upgrade. But there is no options available to Downgrade the MySQL version from WHM.
How ever we can downgrade MySQL version form command line in cPanel server.
You can follow the bellow given steps to MySQL version downgrade (from 5.1 to 4.0) in a cPanel server:
Before you downgrade the MySQL version you need to do the following steps so as to avoid data loss or file corruption
Check the MySQL version by using the following command
#rpm -qa |grep MySQL
Check the server OS:
# cat /etc/issue
# cat /etc/redhat-release
CentOS release 5.5 (Final)
Server architecture check:
Before downgrading we need to backup MySQL databases so as to avoid data corruption so we are copying the mysql database folder by using the following command:
#cp -arp /var/lib/mysql /var/lib/mysql.bak
Then dump the mysql databases using the following command:
#mysqldump -u root -p(password) –all-databases > dumpfilename.sql
You can also take version compatible downgrade dump to check for any missing file restoring by using the following command:
#mysqldump -u root -p(password) –all-databases –compatible=mysql40 > versioncompatibledumpfilename.sql
Actual MySQL down-gradation
Then now we can start the down-gradation process:
First you need to open the cpanel.conf file and make changes to the MySQL-version line from 5.1 to 4.0 by following the using the command:
Change the line
mysql-version=5.1 to mysql-version=4.0
After changing the MySQL version line from 5.1 to 4.0 in the configuration file we need to run the following command to force the MySQL up-gradation/Down-gradation:
Now the MySQL version down-gradation will take place, once the process is completed you can check the version of MySQL which will be:
# rpm -qa | grep -i mysql-
Restart MySQL services by using the following command:
Now re-run apache build (easyapache) – so it can build php-mysql connector:
That’s all the MySQL version has been downgraded successfully.
if you need for more help please contact us today https://pamirwebhost.com