How to migrate your Database from badsource MySQL to OpenSource MariaDB

By | September 30, 2013


Ever since Oracle took over MySQL it has stopped it’s Contribution to the opensource community in favour of Oracle DB.

So the Lead Developer from MySQL started MariaDB.

So what is the difference  between MySQl and MariaDB?

Well besides  the fact that it is completely opensourced, It also supports a number of Storage Engines including Percona’s famous Xtradb.

How do I migrate from MySQL to MariaDB?

It is not that difficult to migrate since mariadb uses almost the same source code.

The below steps are for Red Hat, Centos and Fedora for Ubuntu or Debian please use apt-get.

First we need to take a backup of our MySQL Database with the following command

mysqldump -u root -p --all-databases > mysqlbackup.sql

Then backup our my.cnf file

cp -a /etc/my.cnf my.bak

Now stop mysql server and remove mysql install

service mysqld stop

yum remove mysql mysql-server mysql-libs

Now you need atomic repo or mariadb repo 

I prefer atomic so as it has the latest php software as well

wget -q -O - | sh

yum install mariadb-server

This will install the client and libraries with the one command.

Copy the my.bak to mariadb conf file.

cp my.bak /etc/my.cnf

service mysqld start
mysql -u root -p -Be 'show databases'
enter password

Should show you all the databases. I also had my Replication up an running which was great.

Update: Incase you get a mysql-libs error as follows

Error: mariadb-libs conflicts with mysql-libs

Then uninstall mysql-libs with the yum command below and then try installing again.

yum remove mysql-lib

Please ensure you be careful while doing this and this post assumes you know what you are doing and take full responsibility for the same

Category: MariaDB MySQL OpenSource Tags: , ,

About Leo

Is a Tech Support Manager ,a Linux Enthusiast , Developer and a Tech Writer. He is passionate about open source technology and writes mostly about open source software like Linux. He is interested in enlightening people about Linux and opensource Technologies. You can connect with him on twitter leog_in or write to him at, Github :

4 thoughts on “How to migrate your Database from badsource MySQL to OpenSource MariaDB

  1. Dave Stokes

    What is this rubbish about MySQL no longer contributing to the open source community? Have you been paying attention to MySQL 5.5, 5.6, or 5.7 — all open source BTW — and new projects like Fabric.

    1. Leo Post author

      Dave, Most of the Enterprise MySQL software is paid whereas in Mariadb it is free, check it out here

  2. SAB

    Nice job.

    Also, it would be nice if you add more details about “xtradb vs innodb”


Leave a Reply

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