简体   繁体   English

Percona 是否向后兼容 MySQL? 导轨盒中的 Ruby

[英]Is Percona backwards compatible with MySQL? The Ruby in Rails Case

I'm starting a Ruby on Rails project and I'm interested in using Percona as my DBMS.我正在启动一个 Ruby on Rails 项目,我有兴趣使用 Percona 作为我的 DBMS。 I've read that Percona is fully compatible with MySQL tooling我读过 Percona 与 MySQL 工具完全兼容

I wonder if I can use Ruby on Rails tooling with Percona (using the MySQL support)?我想知道我是否可以在带有 Percona 的 Rails 工具上使用 Ruby(使用 MySQL 支持)?

I recently switched to Percona as well, you just need to install the mysql development library they provide, for ubuntu/debian you need to run: sudo apt-get install libmysqlclient-dev我最近也切换到 Percona,您只需要安装他们提供的 mysql 开发库,对于 ubuntu/debian,您需要运行:sudo apt-get install libmysqlclient-dev

Install mysql/mysql2 gems as normal, no need to specify mysql_config location.正常安装 mysql/mysql2 gems,无需指定 mysql_config 位置。

As long as you have the mysql client libraries you should be able to build the mysql gem which is the interface rails (through active record) uses to interact with mysql.只要您拥有 mysql 客户端库,您就应该能够构建 mysql gem,它是用于与 mysql 交互的接口导轨(通过活动记录)。

You may have to pass the percona mysql_config when building the gem like so:在构建 gem 时,您可能必须传递 percona mysql_config,如下所示:

gem install mysql -- --with-mysql-config=/usr/local/percona-xtradb/bin/mysql_config

If you are using the mysql2 gem you "shouldn't" need to do this (I think)如果您使用的是 mysql2 gem,您“不应该”需要这样做(我认为)

I'm on CentOS 5 using Percona 5.5 and was having trouble installing the mysql gem.我在使用 Percona 5.5 的 CentOS 5 上安装 mysql gem 时遇到问题。 And as mentioned above, you just need the appropriate percona devel libraries for your system.如上所述,您只需要适合您系统的 percona 开发库。

Get them here: http://www.percona.com/downloads/Percona-Server-5.5/在这里获取它们: http://www.percona.com/downloads/Percona-Server-5.5/

If you have Ruby 1.8.5, install the gem with:如果您有 Ruby 1.8.5,请使用以下命令安装 gem:

gem install mysql --no-ri --no-rdoc -v 2.7  -- --build-flags --with-mysql-config

If you have 1.8.6 or above, use:如果您有 1.8.6 或更高版本,请使用:

gem install mysql --no-ri --no-rdoc -- --build-flags --with-mysql-config

You might be able to omit some of those parameters, but that is what I've found to work well given the different Ruby versions..您可能可以省略其中一些参数,但鉴于不同的 Ruby 版本,我发现这些参数效果很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM