Wednesday, January 11, 2012

Installation of Mysql 5.5 on CentOS 5.x

This particular sub-entry focuses on installing MySQL 5.5 on CentOS 5.7.
For reference, CentOS ships with MySQL 5.0.77 by default, at the time of this entry (January 2012). This entry does not involve any migration and assumes a new server is being deployed. Nonstandard repos are required (remi and EPEL)

0. Login as root

1. Remove previously installed MySQL (if applicable)
yum erase mysql

2. Install additional repos

Navigate to temporary directory
cd /tempInstall EPEL repo

UPDATE 11 MAY 2012: The above URL is sporadic. Please use this alternative if the original does not work. -

rpm -Uvh epel-release-5-4.noarch.rpm

Install remi repo
rpm -Uvh remi-release-5.rpm

3. Ensure the repo contains MySQL 5.5
yum --enablerepo=remi list mysql mysql-server
4. Install MySQL 5.5
yum install --enablerepo=remi mysql*

5. Start MySQL and configure to start on boot
service mysqld start
chkconfig mysqld on 

6. Run mysql upgrade script
mysql_upgrade -u root -p

7. Change Mysql default Password 
/usr/bin/mysqladmin -u root password 'yourpasswordhere'

8. Check to ensure mysql 5.5 is installed.
mysql --version

That's it! MySQL 5.5 should now be installed. Dont forget to tune your server: