How to upgrade to MySQL 5.5 and PHP 5.4 in Plesk 11.5 (CentOS)

- by

Plesk-LogoOne of my clients wanted to run a web application that required MySQL 5.5 instead of the default MySQL 5.1 that ships with Plesk at the time of writing. He needed it due to the better handling of UTF8 characters.

I struggled to find clear instructions on how to do this – so here they are 😉

CentOS 5.x

In CentOS 5 you can switch to MySQL 5.5 under Tools and Settings – Updates and Upgrades. The installer shows something like this:

Screen Shot 2014-02-16 at 11.46.19

Simply switch to MySQL 5.5 (packaged by Parallels) and hit install.

CentOS 6.x

Sadly the above convenience doesn’t exist in CentOS 6, so we’ll have to make use of the excellent Atomic repository again. In the past I’ve experienced instabilities in the way Plesk may react to non-standard repo packages – but it appears this is no longer an issue (or so I was told). Suffice to say proceed at your own risk and test, test and test again before using this in a production environment.

Install access to the Atomic repo with this command:

wget -q -O - | sh

You’ll have to agree to some terms and conditions, after which you can simply use yum update to include some additional functionality that is not provided by CentOS or Parallels. Doing so will automatically update both MySQL and PHP for you.

Restart the server when you’re finished for good measure.

Testing: Before and After

You can check which versions are installed. I’d recommend you do this before and after the update.

To check the current PHP version execute the following:

php -v

// before
PHP 5.3.3 (cli) (built: Dec 11 2013 03:29:57) 
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with the ionCube PHP Loader v4.2.2, Copyright (c) 2002-2012, by ionCube Ltd.

// after
PHP 5.4.25 (cli) (built: Feb 10 2014 08:04:23) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
    with the ionCube PHP Loader v4.4.1, Copyright (c) 2002-2013, by ionCube Ltd.

MySQL will show you the version number as soon as you log in to the command line. Do it with this command which will extract the current MySQL admin password from the Plesk database:

mysql -uadmin -p`< /etc/psa/.psa.shadow `

// before
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 747
Server version: 5.1.73 Source distribution

// after
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 5.5.36-cll-lve MySQL Community Server (GPL) by Atomicorp

Run the MySQL upgrade script

To complete the MySQL upgrade, there's a command which updates all existing databases on the system (including psa). Thanks to my client for pointing this out 😉

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

I've heard that in rare cases you may have to use some --force here.

Let me know if this helps!

If you enjoy my content, please consider supporting me on Ko-fi. In return you can browse this whole site witout any pesky ads! More details here.

21 thoughts on “How to upgrade to MySQL 5.5 and PHP 5.4 in Plesk 11.5 (CentOS)”

  1. Hi, I tried to update MySQL and when I check the version using your command it says that I have MySQL 5.5 which is needed and when I try to install Joomla using the plesk installer I get an error saying that MySQL 5.1 or later is needed to install Joomla

  2. Hi Jorge, there’s only one explanation: Joomla is lying to you 😉

    Which version of Plesk have you got? And which version did you have before the upgrade? You can verify your current MySQL version under Plesk Components – Server Components.

  3. Hello Jay. Thank you very much for share this with us. When I mark PHP 5.3 and MySQL 5.5 and click on continue, a new window appear refering the next error:

    An internal error occured in auto-installer, rev.340583 WebUiTransport.cpp, line 385.

    I am using Parallels Plesk version 10.4.4_build1013111102.18 os_CentOS 5 Do you know how can I resolve that issue please?

  4. Hi Jonathan, happy Cinco de Mayo 😉

    I’ve not seen that error before on Plesk 10 on CentOS 5. I would probably try to upgrade MySQL and PHP in separate steps and see if that works. Alternatively use the command line instructions I’ve described in the CentOS 6 section: add the Atomic Repo and issue “yum update”. Should work fine on CentOS 5.

  5. Hi Jay. Thank you very much for your wish of 5 may and your answer. I tried upgrade each package individually also, but occurs the same. I will do the repo indication for CentOS 6. Thanks.

Add your voice!

This site uses Akismet to reduce spam. Learn how your comment data is processed.