// Tutorial //

Switching to MariaDB from MySQL

Published on July 18, 2013
Default avatar
By Etel Sverdlov
Developer and author at DigitalOcean.
Switching to MariaDB from MySQL

Intro

Arch Linux has recently made MariaDB their default implementation of MySQL in their distribution and has recommend that all users upgrade to it. In April, Wikipedia announced that they had switched their English and German wikipedias to run on MariaDB. Fedora 19 has MariaDB as their default SQL database.

About MariaDB

MariaDB is an open source fork of MySQL developed and worked on by the original MySQL developers, lead by Michael “Monty” Widenius. It was created and embraced by the open source community as an effective alternative to MySQL. Although MySQL is still an open source project, it is owned by Oracle, purveyors of their own enterprise software. Worries about the progress of MySQL as well as the status of MySQL as an open source project have prompted the migration to MariaDB. A bug snafu that removed the GPL license from MySQL’s man page caused additional consternation in the open source community as it seemed to restrict the replication of the man pages. Oracle quickly reported this issue as a bug and corrected the copyright notice. Nonetheless, this event was another reminder of how quickly corporate policies could affect the MySQL community.

When summarizing Wikipedia’s move to MariaDB, the announcer Asher Feldman, included a hint as to why he switched: “…as supporters of the free culture movement, the Wikimedia Foundation strongly prefers free software projects; that includes a preference for projects without bifurcated code bases between differently licensed free and enterprise editions.” Oracle’s different treatment of the enterprise and community versions is another factor that caused a stir. At this point, the future of MySQL, subject to decisions of Oracle, remains murky.

Moving to MariaDB

Moving to MariaDB is made to be simple. The database is a drop in replacement for Mysql, launching with the same commands.

In order to upgrade, the user can simply

No further steps are necessary. Once MySQL is off the server and MariaDB is in its place, you can manage your data just as you did before:

Databases, content, and information should carry over between the two programs even without a MySQL dump being performed. Starting up, and using MariaDB requires all of the same commands as MySQL—once Maria is installed, no further changes need to be made.

MariaDB’s Version Numbers

As MariaDB works to be as similar as possible (barring any improvements made to the code on MariaDB’s side) to MySQL, its version numbers used to correlate directly with MySQL’s. To this effect, MariaDB 5.5 had all of the features of MySQL 5.5, as well some of the original ones that improved upon MySQL’s functionality.

However, as MariaDB continues to build out its own features and divest from MySQL, MariaDB version names are taking on a new convention. With the differing schedules of MySQL and MariaDB feature releases, MariaDB’s latest version is 10.0.

A Note for DigitalOcean

Within the DigitalOcean collection of articles, we currently have a lot of pieces focused on MySQL. However, since the growth of MariaDB, we do recommend using MariaDB in the place of MySQL. The instructions within the articles should remain unchanged.


Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in our Questions & Answers section, find tutorials and tools that will help you grow as a developer and scale your project or business, and subscribe to topics of interest.

Sign up
About the authors
Default avatar
Developer and author at DigitalOcean.

Still looking for an answer?

Was this helpful?
5 Comments

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Just one note: you do NOT need uninstall MySQL from your server. Your existing MySQL installation will be automatically upgraded to MariaDB.

Can i use MARIADB10.1 for my wordpress blog previously using mysql 5.5?

I am having Master-Master replication in production using MySQL. Can I upgrade one of the primary node to MariaDB directly, without affecting the cluster?

CentOS 7 comes with MariaDB instead of MySQL. So if you do “yum install mysql” it will install MariaDB. Also you don’t need to do much switching to MariaDB however when you install the mysql2 gem do this:

This was tested in CentOS 7 and Debain 7 with MariaDB. First install the necessary MariaDB so you get “mysql_config” file. Look for “devel” and “common” at the end.

For bundle

bundle config build.mysql --with-mysql-config=/usr/bin/mysql_config

OR just to install the gem

gem install mysql --with-mysql-config=/usr/bin/mysql_config

Thank you for this tutorial.