WordPress with MariaDB instead of MySQL

So I heard good things about MariaDB and decided to switch from MySQL to MariaDB. MariaDB is a fork of MySQL developed by the original developers of MySQL and it is intended to be a drop in replacement – meaning all your commands and databases from MySQL should continue to work seamlessly after the switch.

Tall claim, but with years of relationships with webservers, it isn’t too tough to know that even an upgrade can break things. Here, however seamlessly, the DATABASE management software was being replaced. Only a complete novice would believe “as advertized” to the point of not being worried.

My biggest fear was breaking my blogs. Backups are there, but…. it is unpleasant to see your precious sites not working, and I was apprehensive.

So anyway, I did it.

Added the repository (these are my instructions, but they helpfully provide a configurator for customized MariaDB repositories for your Operating System – version – MariaDB version, which you should totally use).

sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
sudo add-apt-repository 'deb http://mirrors.hustunique.com/mariadb/repo/5.5/ubuntu saucy main'

I’d done paranoid backups to the nth degree before, as you should too, but I won’t bore you with the details. Suffice it to say that I had 3 of each database AND a snapshot of my VPS to restore with “one click” if I got itchy AND I copied the mysql directory anyway (I really love my blogs. Really). I think this was mostly of therapeutic value after the first backup, but hey, it was good for my blood pressure.

Updated and installed MariaDB.

sudo apt-get update
sudo apt-get install mariadb-server

The only pain here was that the repository I used was agonizingly slow to download from, which really did not help my anxiety levels, since I’m used to the more blazing fast ubuntu repositories. Or perhaps it was a temporary patch of bad network I hit.

Regardless, if you are superstitious, you may want to avoid this one.

After a wait that almost had me too old to care, the installation was done.

That is it. There was no noticeable difference to my site except seeming slightly faster. I noticed the configuration file got replaced, but the defaults are good enough that the blogs are completely normal. I expect once I get around to tweaking it, the performance may get even better, but this is good already.

The backups did not get used. A textbook “drop in”. Zero hassle.

Do it already. The only cure for your wondering is finding out.

6 thoughts on “WordPress with MariaDB instead of MySQL

    1. Vidyut

      You can’t, unless your shared hosting provider is using MariaDB, which some do, I hear and with Google shifting to Maria DB, it is near guaranteed that both development as well as usage will increase.

      That said, I would recommend you try a Digital Ocean hosting (disclosure: affiliate link, but genuine recommendation). With VPS hosting with 512M RAM starting at $5 per month, there really is no excuse to continue paying for shared hosting and its environment limitations.

      In my view, it doesn’t make sense to shift to shared hosting for MariaDB, but it definitely does, to be able to use things like Nginx, pagespeed, APC and memcache, Varnish and such things that can add both features and speed to your website. The unique IP address can’t harm either.

      Reply
    1. Vidyut Post author

      I’m using the 5 branch. Had been planning to use the 10 branch, but never seem to find the time these days. I’m leery of doing such things in limited time, as I have crashed my system a few times in the past – or simply got into some configuration issue and such :( Do let me know how it goes if you do.

      Reply

Leave a Reply

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