RedHat / Centos 6.x: Upgrade or install MySQL 5.6 (fixed again)

4

MySQL 5.6 has been released as GA and as per Oracle  Notes http://www.oracle.com/us/corporate/press/1904335

“With increased performance, scalability, reliability and manageability, MySQL 5.6 helps users meet the most demanding Web, Cloud and embedded application requirements.”

So lets try to install it on an existing Centos 6.3 OpenVZ Container running LAMP.

Its my Lab container with WordPress and other things running. There is already mysql-5.1.67 on it which we will remove.

Please make sure you have a backup / snapshot to roll back if it breaks anything or doesn’t work or perform as expected.

We start getting the rpm packages.

You can browse for the latest version packages here

cd /tmp
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/MySQL-server-5.6.12-2.el6.x86_64.rpm/from/http://cdn.mysql.com/
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/MySQL-client-5.6.12-2.el6.x86_64.rpm/from/http://cdn.mysql.com/
wget http://www.mysql.com/get/Downloads/MySQL-5.6/MySQL-shared-compat-5.6.12-2.el6.x86_64.rpm/from/http://cdn.mysql.com/

libaio is needed

yum install libaio

Now it’s time to say good bye to the old mysql.

yum remove mysql mysql-server mysql-libs

Hello mysql 5.6

rpm -ivh MySQL-shared-compat-5.6.12-2.el6.x86_64.rpm
rpm -ivh MySQL-server-5.6.12-2.el6.x86_64.rpm
rpm -ivh MySQL-client-5.6.12-2.el6.x86_64.rpm

(updated) I now need to hijack the remi repo to get the latest php.

rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

We need to enable the repo now.

vi /etc/yum.repos.d/remi.repo
[remi]
name=Les RPM de remi pour Enterprise Linux 6 - $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/6/remi/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/6/remi/mirror
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
[remi-test]
name=Les RPM de remi en test pour Enterprise Linux 6 - $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/6/test/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/6/test/mirror
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

in order to get the php-mysql running I run an update to get the latest php and installed php-mysql.

yum update
yum install php-mysql

Here it told me that “Package php-mysql is obsoleted by php-mysqlnd, trying to install php-mysqlnd-5.5.0-0.20.201303201430.el6.remi.x86_64 instead.

Confirm this and then you should be ready to go.

Finally start mysql. Please note that for whatever reason its now called mysql not mysqld anymore. Don’t ask me why it took me 5 minutes to spot that cause I was already way deeper looking for the issue 😉 .

service mysql start
Starting MySQL.. SUCCESS!

All I can say from some first testing, is that my WordPress (which is a mysql nightmare performance wise anyway) seems to run smooth (maybe even a bit smoother than usual) . But this is a total subjective feeling and not measured yet.

Have fun with bleeding edge mysql.

4 thoughts on “RedHat / Centos 6.x: Upgrade or install MySQL 5.6 (fixed again)

    1. Obregado Jefferson. I went back and played again with it and updated the how-to.
      it’s not just the package but its the whole php dependencies which were not satisfies. I took the remi repo where there are some later releases of php and the new php-mysql.

  1. After this installation I get error Your PHP MySQL library version mysqlnd 5.0.11-dev – 20120503 – $Id: 40933630edef551dfaca71298a83fad8d03d62d4 $ differs from your MySQL server version 5.5.30. This may cause unpredictable behavior.
    in phpmyadmin. What to do?

    1. Sorry that seems to be some screwed up xcache dependencies.
      I use php-pecl-apc since it comes from the same php maintainers.
      http://jayant7k.blogspot.ie/2011/06/opcode-cache-comparison-xcache-versus.html

      [root@Owncloud ~]# rpm -q php-xcache
      package php-xcache is not installed
      [root@Owncloud ~]# rpm -q php-mysql
      package php-mysql is not installed
      [root@Owncloud ~]# rpm -q php-mysqlnd
      php-mysqlnd-5.5.0-0.20.201303201430.el6.remi.x86_64

      after a yum remove php-pecl-apc and trying to install xcache its asking for more weird stuff

      Requires: php(zend-abi) = 20100525-x86-64
      Installed: php-common-5.5.0-0.20.201303201430.el6.remi.x86_64 (@remi-test)
      php(zend-abi) = 20121212-64

      as per http://rpm.pbone.net/index.php3/stat/4/idpl/19937742/dir/redhat_el_6/com/php-xcache-3.0.1-1.el6.remi.x86_64.rpm.html it depends on even more stuff that I can’t find in any repo. you might want to ditch xcache and go for yum install php-pecl-apc

Leave a Reply