使用 percona 服务器安装 ruby mysql gem
新安装cent os 5.4;全新安装 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 ***
似乎表明它无法找到开发库。我知道我通常会使用附加选项 -- --with-mysql-lib=... 但我不相信它们是作为此处概述的正常 percona 安装的一部分安装的: percona 存储库信息
所以我尝试执行 yum install mysql-devel 但与 percona 的东西发生冲突。我发现这篇文章其中建议的解决方案是使用 --with-mysql-config 选项。 Percona 在安装时不会自动在 /etc/my.cnf 中安装 my.cnf,因此我创建了一个 my.cnf 并将其放在那里,因为这是 mysql 的 init.d 脚本检查它的地方。重新启动 mysql,确认它现在正在加载该配置并再次尝试安装,但仍然失败,并显示
“Exec 格式错误 - /etc/my.cnf --cflags (Errno::ENOEXEC)”
感谢任何帮助
我也做了一个 find / -name mysql.h 但什么也没做,所以看起来在使用 yum 安装 percona 服务器和客户端后所需的库不存在
New install of cent os 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
/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
So I tried doing yum install mysql-devel but get a conflict with the percona stuff. I found this post where the proposed solution was using the --with-mysql-config option. 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. Restarted mysql, confirmed that it's now loading that configuration and attempted the install again, but still failed with
"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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您正确添加了 Percona yum 存储库,则只需安装
Percona-Server-devel
软件包:将 55 替换为您当前使用的 Percona Server 版本。
之后,mysql gems将正确安装。
If you correctly added Percona yum repository you just need to install the
Percona-Server-devel
package:Replace 55 with the Percona Server version you're currently using.
After that, mysql gems will install correctly.
我已经从 Percona 重新安装了 libmysqlclient-dev。
然后重新安装mysql& mysql2 宝石。
I've reinstalled libmysqlclient-dev from Percona.
And then reinstalled mysql & mysql2 gems.
经过几个小时的麻烦之后:
发现以下内容可以使用 percona 5.6 安装 mysql gem:
http://www.percona.com/doc/percona-server/5.6/release-notes/Percona-Server-5.6.16-64.1.html
YIHAA - 它有效!
After troubling hours and hours and many hours:
Found the following to install mysql gem with percona 5.6:
http://www.percona.com/doc/percona-server/5.6/release-notes/Percona-Server-5.6.16-64.1.html
YIHAA - It works!
对于任何尝试安装这个 gem 的新人(这个问题在搜索排名中出现得很高),请确保您正在传递 mysql 目录,例如:
For any new people trying to install this gem (this question shows up highly in search ranks), make sure you're passing the mysql directory, like: