kieranbarnes Independent PHP, WordPress & CubeCart Programmer

MySQL 5.0 or 5.1 to 5.5 Upgrade Traumas on CentOS

Posted on January 7, 2012

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

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

  1. wget http://www.mysql.com/get/Downloads/MySQL-5.5/[codesyntax lang="bash"]
  2. rpm -e MySQL-server-5.5.19-1.rhel5.x86_64
.rpm/from/http://mirrors.ukfast.co.uk/sites/ftp.mysql.com/ rpm-ivh MySQL-server-5.5.19-1.rhel5.x86_64.rpm

[/codesyntax]

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

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

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

  1. cp /usr/share/mysql-5.5-copy/english/errmsg.sys /usr/share/mysql/english/errmsg.sys

Start the server

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


Related posts

  1. MySQL Server on CentOS, what the RPM doesn’t do for you
    Installing MySQL via YUM Once the updates have finished we will be ready to install...
  2. [Snippet] Allow mysql root access from anywhere
    A small annoyance of mine is on local development servers, I can't login to the...
  3. cPanel MySQL Tuning
    The default configuration for MySQL provided by cPanel is pretty barren. /etc/my.cnf Thats it. One...
  4. Upgrading to MySQL 5.1 in cPanel/WHM
    Upgrading to MySQL 5.1 in cPanel is currently not the easiest thing in the world....
  5. Installing nginx & PHP-FPM securely on CentOS
    I won't go into the reasons why you should install nginx, if you're here, you've...

Comments (1) Trackbacks (0)
  1. Sweet Baby!!!
    This really saved me a heck of grief. Thanks for the awesome post.
    jaysunn


Leave a comment

(required)

No trackbacks yet.