Upgrading to MySQL 5.1 in cPanel/WHM

Upgrading to MySQL 5.1 in cPanel is currently not the easiest thing in the world. I’ve seen guides detailing disabled various cPanel updates, hacking cPanel scripts and even installing your own 5.1 RPMs, all of which will probably end in tears at some point when cPanel runs one of its update scripts.

Heres the easiest and safest method I’ve found.

1. Edit cPanel update tree

[codesyntax lang=”bash”]
nano /etc/cpupdate.conf

Find CPANEL=release and replace with CPANEL=edge

2.Force a cPanel update

[codesyntax lang=”bash”]
/scripts/upcp –force

This should make sure all your dependencies and other cPanel related files are up to date before we upgrade MySQL.

3.  Edit the main cPanel config

[codesyntax lang=”bash”]
nano /var/cpanel/cpanel.config

Find mysql-version=5.0 and replace with mysql-version=5.1

4. Run the MySQL update script and wait. It doesn’t echo any output so be patient.

[codesyntax lang=”bash”]
/scripts/mysqlup

5. Finally, check the update went well

[codesyntax lang=”bash”]
mysql -V

You should get something like this

mysql  Ver 14.14 Distrib 5.1.56, for unknown-linux-gnu (x86_64) using readline 5.1

6. Finally, you should rebuild Apache & PHP to get the new statically loaded libraries. If you don’t you may get  MySQL library error

php: /usr/lib64/libmysqlclient.so.15: version `libmysqlclient_15′ not found (required by php)

[codesyntax lang=”bash”]
/scripts/easyapache

Done! No nasty hacks, just pure cPanel scripts.

Author: Kieran Barnes

Kieran is a PHP developer with 15 years commercial experience. Specialist in WordPress, CakePHP, CubeCart and all things PHP.

3 thoughts on “Upgrading to MySQL 5.1 in cPanel/WHM”

  1. Thanks dude. It is very cleanly written and accurate. You saved a lot of time for me.

Leave a Reply

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