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.
- i. I like to do a mysqldump
- ii. I also like to copy the /var/lib/mysql for extra safety, but hey, it’s your job on the line!
Next, is a little unorthodox, I removed MySQL completely
yum remove mysql*
Next, I had to download the RPM from MySQL – http://www.mysql.com/downloads/mysql/#downloads
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 http://www.mysql.com/get/Downloads/MySQL-5.5/[codesyntax lang="bash"] rpm -e MySQL-server-5.5.19-1.rhel5.x86_64
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
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.
cp /usr/share/mysql-5.5-copy/english/errmsg.sys /usr/share/mysql/english/errmsg.sys
Start the server
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