Use MariaDB instead of MySQL in my Rails project Use MariaDB instead of MySQL in my Rails project ruby-on-rails ruby-on-rails

Use MariaDB instead of MySQL in my Rails project


It doesn't look like openSUSE has a MariaDB client development package. You must install the libmysqlclient-devel package package. Since MariaDB is tagged as a drop in replacement for MySQL, it would have to support the MySQL clients, though you may lose tiny bits of MariaDB improvements.

It appears that the mysql2 gem should function with the MariaDB client libraries. Other options are hoping the mariadb-client package is enough, find a 3rd party package for the libraries or installing them yourself.

UpdateThere is now an MariaDB repository for openSUSE. It includes a development package, and very good instructions. Place the following in a file under /etc/zypp/repos.d/

# MariaDB 10.1 openSUSE repository list - created 2015-10-20 16:37 UTC# http://mariadb.org/mariadb/repositories/[mariadb]name = MariaDBbaseurl = http://yum.mariadb.org/10.1/opensuse13-amd64gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDBgpgcheck=1

Now you can run zypper install MariaDB-client MariaDB-devel


Your question isn't about Ubuntu, but I'm sure a lot of people Googling Ubuntu (or its derivatives like Mint) will land on this page. In Ubuntu, you have to install all the packages using the MariaDB Foundation's ppa, but they include all the development libraries and support the 5.5, 10.0 and 10.1 releases. Then you can install packages such as mariadb-server, mariadb-client, libmariadbclient-dev, and libmariadbclient-dev:i386 (32-bit client).

The instructions are simple and detailed on the site. For example, installing just the 10.1 dev libraries in Ubuntu 14.04

sudo apt-get install software-properties-commonsudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943dbsudo add-apt-repository 'deb http://mirrors.syringanetworks.net/mariadb/repo/10.1/ubuntu trusty main'sudo apt-get updatesudo apt-get install libmariadbclient-dev


On linux mint, I was able to install:

sudo aptitude install libmariadbclient-dev:i386 libmariadbclient-dev


For recent ubuntu 15.04 vivid and Debian 8.0 Jessie:

No need to install from a ppa (mariadb-server is included), but you have to install libmariadb-client-lgpl-dev and libmariadb-client-lgpl-dev-compat and configure the gem to use mariadb_config:

apt-get install mariadb-server libmariadb-client-lgpl-dev libmariadb-client-lgpl-dev-compatgem install mysql2 -- --with-mysql-config=/usr/bin/mariadb_config# or for bundlerbundle config build.mysql2 --with-mysql-config=/usr/bin/mariadb_configbundle install