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:



  1. error with


    OK with

  2. Both are not working now..!

  3. That's strange, it seems to be related to the site URL that changed.

    This works:

    I'll update the original post. Thanks

  4. now it is:

  5. rpm -Uvh

  6. Thank you for this blog.

    It's very helpful for me!!

    It's working well!!

    Thanks again~!

  7. You are a saint.
    I have been bashing my head against the wall trying to get anything newer than 5.1 installed and I couldn't find a repo that had it. (linux is not a strongsuit).
    I'm running CentOS 6 (did oracle linux first) both using el6 so I just changed a few things in your doc to match - and bingo - 5.5.33.
    Thank you so much.

  8. If i want to install a specific version, say 5.5.21, how can I do that ?