在我的Rails项目中使用MariaDB代替MySQL [英] Use MariaDB instead of MySQL in my Rails project

查看:110
本文介绍了在我的Rails项目中使用MariaDB代替MySQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Rails项目中使用MariaDB代替MySQL?

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

当我尝试安装mysql2 gem时,由于找不到mysqlclient,它返回错误.

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

这里有一些解决方案,但是我在openSUSE上没有找到任何 libmariadbd-dev 软件包. 12.3.

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

推荐答案

openSUSE似乎没有MariaDB客户端开发包.您必须安装libmysqlclient-devel软件包.由于MariaDB被标记为是MySQL的替代品,因此它必须支持MySQL客户端,尽管您可能会损失一点点MariaDB的改进.

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.

看来mysql2 gem应该可以与MariaDB客户端库一起使用.其他选择是希望mariadb-client软件包足够,为该库找到一个第三方软件包或自己安装它们.

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.

更新 现在有一个用于openSUSE的MariaDB存储库.它包括一个开发包和非常好的说明.将以下内容放在/etc/zypp/repos.d/

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

现在您可以运行zypper install MariaDB-client MariaDB-devel

您的问题不是关于Ubuntu的,但我敢肯定很多人会使用Google Going Ubuntu(或类似Mint的衍生产品)进入此页面.在Ubuntu中,必须使用 MariaDB Foundation的ppa ,但它们包含所有开发库并支持5.5、10.0和10.1版本.然后,您可以安装mariadb-servermariadb-clientlibmariadbclient-devlibmariadbclient-dev:i386(32位客户端)之类的软件包.

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).

该说明很简单,并且在网站上有详细说明.例如,在Ubuntu 14.04中仅安装10.1开发库

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

这篇关于在我的Rails项目中使用MariaDB代替MySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆