CPanel Problem Upgrading MySQL 5

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:

which give the error:

first shutdown mysql, if it is running:

ok, lets list all have been done:

remove all the packages:

list what remains uninstalled:

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

list again, should be giving empty result:

run mysqlup again:

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

ok, download the RPM from CPanel:

force install! yes, dirty.. :(

list all packages:

lets try starting mysql:

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 :)

8 thoughts on “CPanel Problem Upgrading MySQL 5”

  1. 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. 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.

  3. 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

  4. Hi,
    Can we really skip the scripts with –noscripts option?? If we use –noscripts options, will it be the complete no installation??

    1. the –noscript option is used to skipping pre- and/or post- installation on RPM hence it’s dangerous (as per RPM documentation), but in this problem i had to use it in order to have mysql upgraded.

      anyway, this post is a very old post. cpanel should have updated their script, it’s better if you do fresh install to get the latest softwares.

Leave a Reply

Your email address will not be published. Required fields are marked *