Downgrade MySQL 5 to MySQL 4.1 on cPanel server

Here you can find tutorials and notes for server-side maintenance/configuration

Downgrade MySQL 5 to MySQL 4.1 on cPanel server

Postby lik » Sun Dec 14, 2008 7:52 am

Downgrade MySQL 5 to MySQL 4.1 on cPanel dedicated server

For some reason (mainly, due to different syntax of GRANT) you need to downgrade MySQL 5 to MySQL 4.1 to achieve this you will have to do the following:
To check the which all mysql rpm’s are available use the command:
Code: Select all
rpm -qa | grep -i mysql-

First of all take a backup of /var/lib/mysql, and also ask the other users to keep a backup it with them. This can also be a .sql file. The command to take a backup is:
Code: Select all
cp /var/lib/mysql /var/lib/mysql.bk

It’s much better to do a mysqldump of your databases than to do a file restore of the databases. This dump can be properly restored into MySQL 4 or 5 (depending on features used) rather than having to totally rebuild MySQL to accommodate the flat file restore.
mysqldump compatibility mode
You can learn about it by reading
Code: Select all
mysqldump --help | less

--compatible=name
    Change the dump to be compatible with a given mode. By
    default tables are dumped in a format optimized for
    MySQL. Legal modes are: ansi, mysql323, mysql40,
    postgresql, oracle, mssql, db2, maxdb, no_key_options,
    no_table_options, no_field_options. One can use several
    modes separated by commas. Note: Requires MySQL server
    version 4.1.0 or higher. This option is ignored with
    earlier server versions.
Now, you will have to edit the cPanel config file and make manual changes under this, so edit it with the command:
Code: Select all
nano -w /var/cpanel/cpanel.config

And here, find for the line “mysql-version=5.0” and change it to “mysql-version=4.1”
Now, we will forcefully install mysql by the following command:
Code: Select all
/scripts/mysqlup --force

You can now check again with the command:
Code: Select all
rpm -qa | grep -i mysql-
lik
Founder
Founder
 
Posts: 497
Joined: Wed Dec 15, 2010 3:21 am

Return to Server Side Actions

 


  • Related topics
    Replies
    Views
    Last post