Wednesday, August 11, 2010

MYSQL Downgrade / Upgrade

MYSQL Downgrade / Upgrade
=========================

Steps
-----

1. Check the mysql version

rpm -qa | grep -i mysql

mysql -v

2. Change the version in configuration file

Before changing th version in config file, backup the same
(cp -arp /var/cpanel/cpanel.config /var/cpanel/cpanel.config.bak)

In /var/cpanel/cpanel.config

Check for the line

mysql-version= 4.1

Change the version as you wish for upgrade or downgrade

Upgrade

mysql-version= 5.0

Downgrade

mysql-version= 4.0

Note: cPanel version 11.24.5-STABLE_38506 supports only mysql versions 4.1 and above

( How to check cPanel Version

/usr/local/cpanel/cpanel version or

vi /usr/local/cpanel/version )

3. Back up the /var/lib/mysql folder

( cp -arp /var/lib/mysql /var/lib/mysql_back )

4. Run the below script using below command

/script/mysqlup -force or
/script/mysqlup -force --password=ROOTPASSWORD

5. check the version of mysql
( rpm -qa | grep -i mysql

mysql -v)

6. /etc/init.d/mysql restart


If the mysql successfully restarts then there is no problem. But if it shows the errors

1. MySQL is not running, but lock exists
2. MySQL PID file could not be found!
3. MYSQL Cannot start because PID file not FOUND

Check the following

/etc/init.d/mysql status

"mysql is not running but lock exists "

Solved by removing the lock file:

rm /var/lock/subsys/mysql

If this happens again it may also be necessary to remove the pid file from /var/lib/mysql

No comments:

Post a Comment