使用 percona 服务器安装 ruby​​ mysql gem

发布于 2024-11-16 19:09:18 字数 1194 浏览 4 评论 0原文

新安装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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

难如初 2024-11-23 19:09:18

如果您正确添加了 Percona yum 存储库,则只需安装 Percona-Server-devel 软件包:

yum install Percona-Server-devel-55

将 55 替换为您当前使用的 Percona Server 版本。

之后,mysql gems将正确安装。

If you correctly added Percona yum repository you just need to install the Percona-Server-devel package:

yum install Percona-Server-devel-55

Replace 55 with the Percona Server version you're currently using.

After that, mysql gems will install correctly.

苍景流年 2024-11-23 19:09:18

我已经从 Percona 重新安装了 libmysqlclient-dev。

然后重新安装mysql& mysql2 宝石。

I've reinstalled libmysqlclient-dev from Percona.

And then reinstalled mysql & mysql2 gems.

亽野灬性zι浪 2024-11-23 19:09:18

经过几个小时的麻烦之后:

发现以下内容可以使用 percona 5.6 安装 mysql gem:

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

gem卸载mysql

apt-get 删除 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 安装 percona-server-server-5.6 percona-server-client-5.6

cd /usr/lib/x86_64-linux-gnu

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

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

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

gem安装mysql

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

gem uninstall 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 install percona-server-server-5.6 percona-server-client-5.6

cd /usr/lib/x86_64-linux-gnu

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

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

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

gem install mysql

YIHAA - It works!

天邊彩虹 2024-11-23 19:09:18

对于任何尝试安装这个 gem 的新人(这个问题在搜索排名中出现得很高),请确保您正在传递 mysql 目录,例如:

 gem install mysql2 -- --with-mysql-dir=/usr/local/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:

 gem install mysql2 -- --with-mysql-dir=/usr/local/mysql
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文