| Subcribe via RSS

CPanel Problem Upgrading MySQL 5

March 31st, 2008 Posted in System Administration

Several months ago I had problem on upgrading CPanel’s MySQL 4.1 to MySQL 5. The problem was occurred on Centos 5 OpenVZ based VPS. Since someone contact me at WebHostingTalk forum asking about the same problem so I decided to re-try again the steps to fix the problem. Hence I post it here too, for future and general purposes :)

ok, do this at your own risk :) backup your mysql data first!

the steps i do:

/scripts/mysqlup

which give the error:

error:   install: %pre scriptlet failed (2), skipping MySQL-server-5.0.45-0.glibc23

first shutdown mysql, if it is running:

service mysql stop

ok, lets list all have been done:

rpm -qa | grep -i mysql
 
MySQL-server-4.1.22-0.glibc23
MySQL-client-5.0.45-0.glibc23
MySQL-shared-5.0.45-0.glibc23
MySQL-shared-4.1.22-0.glibc23
MySQL-devel-5.0.45-0.glibc23
MySQL-bench-5.0.45-0.glibc23

remove all the packages:

rpm -e MySQL-client-5.0.45-0.glibc23
rpm -e MySQL-shared-5.0.45-0.glibc23
rpm -e MySQL-devel-5.0.45-0.glibc23
rpm -e MySQL-bench-5.0.45-0.glibc23

list what remains uninstalled:

rpm -qa | grep -i mysql
 
MySQL-server-4.1.22-0.glibc23
MySQL-shared-5.0.45-0.glibc23
MySQL-shared-4.1.22-0.glibc23

force delete! yes, i know this is a dirty job :(

rpm -e --noscripts MySQL-server-4.1.22-0.glibc23
rpm -e --noscripts MySQL-shared-5.0.45-0.glibc23
rpm -e --noscripts MySQL-shared-4.1.22-0.glibc23

list again, should be giving empty result:

rpm -qa | grep -i mysql

run mysqlup again:

/scripts/mysqlup

it will try to install the mysql 5, but still we’ll got error message:

error:   install: %pre scriptlet failed (2), skipping MySQL-server-5.0.45-0.glibc23

ok, download the RPM from CPanel:

wget http://httpupdate.cpanel.net/mysqlinstall/5.0.45-0/centos/5/MySQL-server-5.0.45-0.glibc23.i386.rpm

force install! yes, dirty.. :(

rpm -ivh --noscripts --nodeps MySQL-server-5.0.45-0.glibc23.i386.rpm

list all packages:

rpm -qa | grep -i mysql
MySQL-devel-5.0.45-0.glibc23
MySQL-bench-5.0.45-0.glibc23
MySQL-shared-5.0.45-0.glibc23
MySQL-client-5.0.45-0.glibc23
MySQL-server-5.0.45-0.glibc23

lets try starting mysql:

service mysql start
Starting MySQL SUCCESS!

the mysql service is running, however I’m not sure with the integrity of the installation. I still prefer installing CPanel from scratch + editing the config file to install mysql version 5.0 instead of 4.1

hope that helps :)

Related Posts

6 Responses to “CPanel Problem Upgrading MySQL 5”

  1. David Grega Says:

    Note, /scripts/mysqlup (also called when you go to the Software section of the WHM interface and click Update Server Software) will only update you to the latest version of the branch of MySQL you are using. Therefore if you are using MySQL 4.1, by design, it will only update you to the latest MySQL 4.1 version. If you are using MySQL 5.0, then it will only update you to the latest 5.0 version.

    Detailed instructions for upgrading from MySQL 4.1 to 5.0 are right in the WHM interface in the setting that controls the MySQL version (in WHM -> Server Configuration -> Tweak Settings -> MySQL).

    Note that after such an upgrade, you should recompile Apache and PHP via EasyApache to ensure PHP scripts interact properly with the new MySQL version rather than generate errors.

    Additionally, MySQL 5.0 is not readily downgradable to 4.1 so be sure to make a backup BEFORE upgrading.


  2. anton ashardi Says:

    hmmm…another great post
    thanks :D


  3. Thomas Says:

    great post. Have been having the same problem, now sorted. Thanks. :)

    @ David Grega. Yeah, the detailed instructions are there but it just fails to update to v5 from v4, does not matter what one does.


  4. pututik Says:

    hmmm, dear markus your website more colorfull now. we like it


  5. Appraiser Finder Says:

    Here is the final step ( CentOS 5 ):

    – Comment out basedir in /etc/my.cnf

    #basedir=/var/lib

    – Create new directory if not exists

    mkdir /var/run/mysqld
    chown mysql.mysql /var/run/mysqld

    – Done

    service mysql start


  6. Markus Says:

    @Appraiser Finder,

    you don’t need to do that steps if you using RPM/YUM to update the MySQL


Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word