Upgrade from MySQL to MariaDB at Debian

Since I’ve decided to improve performance of my webservers (and migrate from Apache2 to Lighttpd) I wondered if I could do something with an MySQL. And after a research I made a decision that I am going to migrate my servers to MariaDB.
If you never heard about MariaDB you should probably know that MariaDB is a fork of MySQL because MySQL has been bought by an evil company and it’s not so much open sourced and the origin creators of MySQL have decided to do better db server and that’s MariaDB and so on and so on. Boring stuff mostly.Why to migrate?

  • open sourced
  • better engines (in my opinion)
  • performance might be slightly better
  • and it’s fully compatible with MySQL. For a now.

How to migrate?

Surprisingly simple. Python software properties are just for adding new repository by add-apt-repository, you don’t need to install this, if you know how to add repository.

# apt-get install python-software-properties

And add keys:

# apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db

Add repository:

# add-apt-repository 'deb http://mirror.stshosting.co.uk/mariadb/repo/10.0/debian wheezy main'

Update packages:

apt-get update

And install MariaDB:

apt-get install mariadb-server

mysql_replace_mariadb.fw

That’s it. During installation will be stopped the MySQL server, installed MariaDB, you will be asked for root password and then will started mariaDB server. Service is still mysqld, actually for you  – nothing changed. Everything works the same way as with the MySQL.

And if have not used the latest mysql version, you should run

mysql_upgrade

after installation.