The Answers Depend On The Question

Upgrading MySQL from 5.1 to 5.5 on CentOS6

I run a bunch of WordPress sites on a CentOS6 server and have been seeing notices to upgrade WordPress to version 4.2. The problem is that my version of MySQL is not supported by WordPress 4.2. The simple solution is to fire up yum and upgrade my current installation of MySQL. Sadly, the default yum repositories do not contain a package for the updated MySQL. So, below are the steps I followed to update MySQL 5.1 to 5.5.

  1. Back up all MySQL databases using mysqldump
  2. Remove the old version of MySQL
    yum remove mysql mysql-*
  3. Download updated repositories for CentOS6
    rpm -Uvh
    rpm -Uvh
  4. Install new MySQL
    yum --enablerepo=remi,remi-test install mysql mysql-server
  5. Start MySQL
    service mysqld start
  6. Make MySQL start on bootup
    chkconfig --levels 235 mysqld on
  7. Check for any updates
    mysql_upgrade -u root -p

I noticed that when I removed the old version of MySQL, the data files were leftover so when I installed the new version of MySQL all my databases were good to go. But, it is always a good practice to do a full backup when doing any type of software updates, especially when you uninstall software. Better to be safe than sorry.


Leave a Reply

Your email address will not be published. Required fields are marked *