Installing MySQL or MariaDB

Odds are if you’ve worked with PHP you’ve also worked with MySQL. While there’s nothing wrong with it, MariaDB is an alternative with more storage engines and better performance. It’s actually developed by the creator of MySQL and the database that Wikipedia uses.

Additionally, if you’re one of the open source advocates, MariaDB is truly open source where as MySQL is actually property of Sun which is now property of Oracle. (What you didn’t know MySQL is owned by Oracle?).

The best part? MariaDB is completely binary compatible to MySQL and you can still use all the tools that you’d normally use for MySQL. So making the switch is actually REALLY easy. Heck, you could make the switch and no one would know. Anyways…..

To you want to install MySQL over MariaDB it’s really simple, just run

apt-get install mysql-server mysql-client

That’s it.

If you want to install MariaDB, it’s a bit more involved but not that much. First you want to get the MariaDB PPA. You can do it by going to

Select your distro (Debian), Release (Debian 7 “Wheezy”), Version 10, and pick a mirror. I chose the iWeb mirror since I’m in Canada.

Once you select all those if you scroll down you’ll see the commands you need to run. I’ll copy and paste what I have so you have a reference (or you can just copy this as well)

sudo apt-get install python-software-properties sudo apt-key adv –recv-keys –keyserver 0xcbcb082a1bb943db sudo add-apt-repository ‘deb wheezy main’

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

(Get rid of the sudo if you’re one of the folks that likes to run everything as root)

Note: I added the mariadb-client as well. The MySQL-client actually works with MariaDB as well.

Check to see if everything is running by using

service mysql status

Yes even though we installed MariaDB, we still call MySQL. Anything that works with MySQL will work with MariaDB.

<– Back to Step 5  |  Onwards to Step 7 –>