Replace MySQL with MiriaDB on CentOS 6

Last modified: [last-modified]

I’m running CentOS 6.3 64-bit and have been for a little while. I decided I wanted to swap out MySQL 5.1.x with MiriaDB 5.3.x.

Why? Because I can. Plus I’ve read a bit and it sounds like MiriaDB is better optimized than MySQL. Also Oracle is evil.

These instructions are based off my history file. I didn’t think to write this down as I did it. That means there may be a mistake in the following process but with some Googling you should be able to fix any problems you come across.

One thing to know beforeĀ proceedingĀ  If you’re using PHP 5.3.3 that comes with CentOS 6 you will get a header miss-match error when PHP uses the ‘php-mysql’ package to access MySQL. I believe you can safely ignore this. I did for a few hours and nothing seemed broken. I’ll include steps on fixing this problem in another post as it requires completely replacing PHP in CentOS with PHP from another repository. If you’ve compiled your own PHP then you’ll just want to re-compile it with the MySQL Native DriverĀ (mysqlnd).

  1. Stop your webserver and any other applications that may be trying to access your MySQL Database
  2. Take a full backup of your MySQL database just in case
  3. Next find out what MySQL RPMs you have installed and remove them. This will automatically create a backup of your existing ‘/etc/my.cnf’ file.
  4. Alright now you’ve got no MySQL on your system. Lets drop MiriaDB in.
  5. You should now have MariaDB 5.3.x installed. Next we want to put the old configuration file back.
  6. Fire up MiriaDB, verify the version and upgrade the databases
  7. Configure MiriaDB to start on boot

That’s it! You should now be running the latest stable version of MariaDB 5.3.x which you will be able to keep up to date with the ‘yum’ command.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.