How to upgrade mySQL on CentOS

By default CentOS 6.5 would be installed with MySQL 5.1 (it puzzles my as 5.1 is archaic, but well…). I was interested in updating my MySQL engine to 5.5 and just happen that when it become a necessity. So after browsing various sites, forums and trying different repos, everything boiled down to the following steps…

DISCLAIMER: These particular steps were tested when upgrading default MySQL 5.1 part of CentOS 6.5 with Plesk 12.


  • you are familiar with SSH
  • and have SSH root access
  • Webtastic repo is used
  • Prior MySQL installation exists (check $ rpm -q mysql mysql-server)

Core update

  • Enable repo – Webtatic EL6 for CentOS/RHEL 6.x
    $ rpm -Uvh
  • Install 5.5 side-by-side, replace engine and resolve dependencies
    $ yum install mysql.`uname -i` yum-plugin-replace
    $ yum replace mysql --replace-with mysql55w
  • And the last step system DB structure need to be updated
    This is very important especially if your Plesk backup start failing with the error

    Not all the data was backed up into XXXXXX successfully.
    mysqldump: Couldn't execute 'SHOW FUNCTION STATUS WHERE Db = 'XXXXX'':
    Cannot load from mysql.proc. The table is probably corrupted (1548)
    $ service mysqld start
    $ mysql_upgrade -u root -p

    If for any reason this fails with error

    Looking for 'mysql' as: mysql
    Looking for 'mysqlcheck' as: mysqlcheck
    FATAL ERROR: Upgrade failed

    try the “backdoor”

    $ mysql_upgrade -uadmin -p`< /etc/psa/.psa.shadow `

    If after that error still present itself try to force upgrade by running the same command with extra key

    $ mysql_upgrade -uadmin -p`< /etc/psa/.psa.shadow ` -f

At that point you all set but it is recommended that MySQL service is restarted

$ sudo service mysqld stop
$ sudo service mysqld start
$ sudo service mysqld status
mysqld (pid NNNN) is running...


This entry was posted in CentOS Maintenance, Scratch Pad. Bookmark the permalink.

5 thoughts on “How to upgrade mySQL on CentOS”

  1. Matt says:

    mysql_upgrade -uadmin -p`< /etc/psa/.psa.shadow ` <— the solution! I was leading towards that command actually myself just verified using your site that it would be appropriate. Thanks for the instructions.

  2. Dennis says:

    Thanks for the backdoor, this did the trick.

  3. Dean Turner says:

    Thank you very much back door option did the trick for me.

  4. Alex says:

    I tried this solution but i kept getting a list of huge dependencies. It started working after i installed the Atomic repo and then just did yum upgrade mysql. I made a quick how to guide on my blog if anyone has the same issues, here:

  5. Jella says:

    Thanks, It worked fine with “mysql_upgrade -u root -p” .

Leave a Reply to Dean Turner Cancel reply

  • About

    From a junior developer through Sr Manager position, I was always interested in new technologies. Passionate speaker, IT junky, developer, architect, team lead, and development manager - many hats, one goal - making software better and being closer to people’s needs. For the most part I am using my blog as a scratch pad, writing small articles on things which I came across, was asked about more then once, and which would otherwise require additional research again and again.

    View Serguei Dosyukov's profile on LinkedIn
  • Testimonials

    I’m a huge fan of this theme. I’ve got more than 90,000 pictures in my gallery3 running on a Ubuntu...


    I've been using this [theme] since the start. It is by far the most attractive, feature packed and stable of...


    The greydragon theme is fantastic. It’s clean, stable and feature rich. It took me a while to decide to move...



  • Categories