MySQL has been a cornerstone of the LAMP stack (and, dare I say, the web in general). MariaDB, for those that don't know it yet, describes itself like this:
An enhanced, drop-in replacement for MySQL.
Given the gut feeling I have about Oracle I have been looking at MariaDB every now and then already. Yesterday I had some free minutes and thought I'd give that claim a test run. I am using MacPorts, so installing MariaDB itself is easy enough:
sudo port install mariadb-server
But, what next? Even though MariaDB is a drop-in replacement, some things needed to be tweaked in my setup. First thing I came to think of, was my PHP configuration, so I replaced the three MySQL default socket settings in /opt/local/etc/php54/php.ini with the new value /opt/local/var/run/mariadb/mysqld.sock (in fact, only the mariadb in those lines is new).
Then I copied my existing database files from /opt/local/var/db/mysql5/ over to the MariaDB location /opt/local/var/db/mariadb/.
Note: By default MariaDB (at least in MacPorts) comes with skip-networking enabled in /opt/local/etc/mariadb/macports-default.cnf, which you may want to disable unless you are working exclusively with sockets.
Finally I started MariaDB after stopping MySQL:
sudo port unload mysql5-server sudo port load mariadb-server
And there I had it: a working replacement for MySQL. The finishing touches included restarting Apache (so PHP picked up the changed default socket) and running
sudo mysql_upgrade -p
to adjust the databases, since this was not only a switch, but also an upgrade - from MySQL 5.1 to MariaDB 5.5.
Oh, and of course:
sudo port uninstall mysql5-server mysql5