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

匿名 (未验证) 提交于 2019-12-03 09:06:55

问题:

I'm starting a Ruby on Rails project and I'm interested in using Percona as my DBMS. I've read that Percona is fully compatible with MySQL tooling

I wonder if I can use Ruby on Rails tooling with Percona (using the MySQL support)?

回答1:

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.

You may have to pass the percona mysql_config when building the gem like so:

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)



回答2:

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

Install mysql/mysql2 gems as normal, no need to specify mysql_config location.



回答3:

I'm on CentOS 5 using Percona 5.5 and was having trouble installing the mysql gem. And as mentioned above, you just need the appropriate percona devel libraries for your system.

Get them here: http://www.percona.com/downloads/Percona-Server-5.5/

If you have Ruby 1.8.5, install the gem with:

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

If you have 1.8.6 or above, use:

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



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!