Redhat Enterprise Linux (RHEL) 5.x and CentOS 5.x have been providing MySQL 5.0 in it’s distribution since that was the active stable branch when RHEL 5.0 was released on 14th March 2007 (CentOS 5.0 on 12th April 2007). Since then, Sun/Oracle have released MySQL 5.1 and MySQL 5.5, so the Webtatic Yum repository has added them to it’s web stack, which now provides updated versions of all the AMP in LAMP.
Update 2013-05-11 – Updated guide to include Webtatic EL6 mysql55 installation and simplfied package upgrade
First, to set up the yum repository, install the webtatic-release RPM based on your CentOS/RHEL release:
Webtatic EL6 for CentOS/RHEL 6.x
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
Webtatic 5 for CentOS/RHEL 5.x:
rpm -Uvh http://mirror.webtatic.com/yum/centos/5/latest.rpm
If you already have MySql client or server installed (rpm -q mysql mysql-server), then you can upgrade using the following method:
yum install mysql yum-plugin-replace --enablerepo=webtatic yum replace mysql --replace-with mysql55 --enablerepo=webtatic
“yum install mysql” is only there to make sure yum-plugin-replace can resolve dependencies correctly if only mysql-server was installed. “–enablerepo=webtatic” is optional on Webtatic EL6
Otherwise, to install MySql client and server, then run:
yum install mysql55 mysql55-server --enablerepo=webtatic
Again, “–enablerepo=webtatic” is optional on Webtatic EL6
You should upgrade existing tables before setting the server to become a production machine, which can be done by starting the server and running the mysql_upgrade script (this may take time depending on the size of the database).
service mysqld start mysql_upgrade
The Webtatic 5 repository for CentOS/RHEL 5.x includes mysql51-* packages for installing MySQL 5.1. This can be installed by replacing in the above commands “mysql55″ with “mysql51″.
As MySQL 5.1 is standard in CentOS/RHEL 6.x, it is not included in the Webtatic EL 6 repository.