简体   繁体   English

使用percona服务器安装ruby mysql gem

[英]Installing ruby mysql gem with percona server

New install of cent os 5.4; 全新安装的操作系统5.4; clean install of percona xtradb server (Server version: 5.1.56-rel12.7 Percona Server (GPL), 12.7, Revision 224) gem install mysql failed with the output 清理安装percona xtradb服务器(服务器版本:5.1.56-rel12.7 Percona Server(GPL),12.7,修订版224)gem install mysql输出失败

/usr/local/rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
checking for mysql_query() in -lmysqlclient... yes
checking for mysql_ssl_set()... yes
checking for rb_str_set_len()... yes
checking for rb_thread_start_timer()... no
checking for mysql.h... no
checking for mysql/mysql.h... no
*** extconf.rb failed ***

which appears to indicate it can't find the dev libraries. 这似乎表明它无法找到开发库。 I know I'd normally use the additional options -- --with-mysql-lib=... but I don't believe they're installed as part of the normal percona install outlined here: percona repositories info 我知道我通常会使用其他选项--with-mysql-lib = ...但我不相信它们是作为此处概述的正常percona安装的一部分安装的: percona存储库信息

So I tried doing yum install mysql-devel but get a conflict with the percona stuff. 所以我尝试了yum install mysql-devel,但与percona的东西发生冲突。 I found this post where the proposed solution was using the --with-mysql-config option. 找到了这篇文章 ,建议的解决方案是使用--with-mysql-config选项。 Percona doesn't automatically install a my.cnf at /etc/my.cnf upon installation, so I whipped one up and placed it there because that's where the init.d script for mysql checks for it. Percona在安装时不会自动在/etc/my.cnf上安装my.cnf,所以我把它打了一个并放在那里,因为这是mysql的init.d脚本检查它的地方。 Restarted mysql, confirmed that it's now loading that configuration and attempted the install again, but still failed with 重新启动mysql,确认它现在正在加载该配置并再次尝试安装,但仍然失败了

"Exec format error - /etc/my.cnf --cflags (Errno::ENOEXEC)"

Thanks for any help 谢谢你的帮助

I also did a find / -name mysql.h and nothing, so it looks like the required libraries are not present after installing both percona server and client with yum 我也做了一个find / -name mysql.h,没有任何东西,所以看起来安装percona服务器和客户端后,所需的库不存在

If you correctly added Percona yum repository you just need to install the Percona-Server-devel package: 如果您正确添加了Percona yum存储库 ,则只需安装Percona-Server-devel软件包:

yum install Percona-Server-devel-55

Replace 55 with the Percona Server version you're currently using. 将55替换为您当前使用的Percona Server版本。

After that, mysql gems will install correctly. 之后,mysql gems将正确安装。

After troubling hours and hours and many hours: 经过几个小时,几个小时和几个小时后:

Found the following to install mysql gem with percona 5.6: 找到以下用percona 5.6安装mysql gem:

http://www.percona.com/doc/percona-server/5.6/release-notes/Percona-Server-5.6.16-64.1.html http://www.percona.com/doc/percona-server/5.6/release-notes/Percona-Server-5.6.16-64.1.html

gem uninstall mysql gem卸载mysql

apt-get remove mysql-server mysql-server-5.5 mysql-client mysql-client-5.5 mysql-client-core-5.5 mysql-server-core-5.5 mysql-common libmysqlclient18:i386 libmysqlclient18:amd64 apt-get remove mysql-server mysql-server-5.5 mysql-client mysql-client-5.5 mysql-client-core-5.5 mysql-server-core-5.5 mysql-common libmysqlclient18:i386 libmysqlclient18:amd64

apt-get install percona-server-server-5.6 percona-server-client-5.6 apt-get install percona-server-server-5.6 percona-server-client-5.6

cd /usr/lib/x86_64-linux-gnu cd / usr / lib / x86_64-linux-gnu

mv libmysqlclient.so.18.0.0 libmysqlclient.so.18.0.0-backup mv libmysqlclient.so.18.0.0 libmysqlclient.so.18.0.0-backup

ln -s libperconaserverclient.so.18.1.0 libmysqlclient.so.18.0.0 ln -s libperconaserverclient.so.18.1.0 libmysqlclient.so.18.0.0

rm -rf /home/slat/.rvm/gems/ruby-XXXXX/gems/mysql* rm -rf /home/slat/.rvm/gems/ruby-XXXXX/gems/mysql*

gem install mysql gem安装mysql

YIHAA - It works! YIHAA - 它的作品!

对于任何尝试安装此gem的新人(此问题在搜索排名中显示得非常高),请确保您传递的是mysql目录,例如:

 gem install mysql2 -- --with-mysql-dir=/usr/local/mysql

I've reinstalled libmysqlclient-dev from Percona. 我从Percona重新安装了libmysqlclient-dev。

And then reinstalled mysql & mysql2 gems. 然后重新安装mysql和mysql2宝石。

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

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