Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use MariaDB instead of MySQL in my Rails project

Tags:

How can I use MariaDB instead of MySQL in my Rails project?

When I try to install mysql2 gem it returns error,because mysqlclient was not found.

Here some solution, but I didn't found any libmariadbd-dev package on my openSUSE 12.3.

like image 308
rthink Avatar asked Apr 30 '13 16:04

rthink


People also ask

Can I run MariaDB and MySQL together?

Yes, it is. Just as two MySQL instances can coexist. MariaDB is still a drop-in replacement. By port or by different socket path, and install MariaDB to a non-standard directory.

Does MariaDB need MySQL to install?

MariaDB was designed as a drop-in replacement of MySQL, with more features, new storage engines, fewer bugs, and better performance, but you can also install it alongside MySQL. (This can be useful, for example, if you want to migrate databases/applications one by one.)

What can I do with MariaDB?

To interface with the MariaDB server, you can use a client program, or you can write a program or script with one of the popular programming languages (e.g., PHP) using an API (Application Programming Interface) to interface with the MariaDB server.


1 Answers

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.

Update There 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 = MariaDB
baseurl = http://yum.mariadb.org/10.1/opensuse13-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=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-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
sudo add-apt-repository 'deb http://mirrors.syringanetworks.net/mariadb/repo/10.1/ubuntu trusty main'
sudo apt-get update
sudo apt-get install libmariadbclient-dev
like image 151
jbo5112 Avatar answered Sep 28 '22 07:09

jbo5112