MySQL 5.0 or 5.1 to 5.5 Upgrade Traumas on CentOS

Ignoring all the panic-mongers on the rest of the internet upgrading MySQL from 5.0 or 5.1 to 5.5 shouldn’t be that difficult. My task was to upgrade from 5.0 to 5.5 on CentOS (Remi Repos). It was to fix a bug with MySQL 5.0 ignoring the wait_timeout parameter in my.cnf.

Five to five on a Friday, I dive into the swamp, which turns out to be full of alligators.

Alligator 1: Version depenencies
Alligator 2: /usr/libexec/mysqld: unknown option ‘–skip-locking’
Alligator 3:  [ERROR] Error message file ‘/usr/share/mysql/english/errmsg.sys’ had only 481 error messages,
but it should contain at least 641 error messages.
Or some other variation of numbers.

Here’s my guide to get round it.

Backup your MySQL data.

  1. i. I like to do a mysqldump
  2. ii. I also like to copy the /var/lib/mysql for extra safety, but hey, it’s your job on the line!
We’re going to remove MySQL, so tight pants and make sure you’ve backed up and done SQL dumps of your data.

Install the Remi Repo if you don’t have it already. Otherwise, follow my other post first.

Next, is a little unorthodox, I removed MySQL completely

[codesyntax lang=”bash”]
yum remove mysql*

Next, I had to download the RPM from MySQL –
I got the Oracle Linux 5 version to match CentOS 5. The file you need is MySQL-server-5.5.19-1.rhel5.i386.rpm or MySQL-server-5.5.19-1.rhel5.x86_64.rpm

We need to install this to get the correct /usr/share/mysql directory. All the repo RPMs I’ve tried don’t include the correct directory and you will get errors as such

[ERROR] Error message file ‘/usr/share/mysql/english/errmsg.sys’ had only 481 error messages, but it should contain at least 641 error messages.

It relates to an error with errmsg.sys

wget[codesyntax lang="bash"]
rpm -e MySQL-server-5.5.19-1.rhel5.x86_64


rpm-ivh MySQL-server-5.5.19-1.rhel5.x86_64.rpm

If that installs succesfully, you need to copy the share directory

cp /usr/share/mysql /usr/share/mysql-5.5-copy -r

Next, get rid of the RPM.

Stupid, huh? Anyway, crack on. Now we can install the Remi Repo provided MySQL

[codesyntax lang=”bash”]
yum -y –enablerepo=remi install mysql-server

Again mysql-server will catch all the required dependencies.

Don’t start  the server just yet.

Firstly, run mysql_install_db

Secondly, run mysql_secure_installation

Finally, we copy the errmsg.sys back.

[codesyntax lang=”bash”]
cp /usr/share/mysql-5.5-copy/english/errmsg.sys /usr/share/mysql/english/errmsg.sys

Start the server

[codesyntax lang=”bash”]
service mysql start

Done! Now you have the fun job of copying the data back.

So, I started at 1655, finished at 2345. Your experience my be slightly shorter!


PS. I’ve attached errmsg.sys for your downloading pleasure so you can skip the whole installing mysql-*.rpm nonsense. Download

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 “MySQL 5.0 or 5.1 to 5.5 Upgrade Traumas on CentOS”

Leave a Reply

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