安装mysql问题

发布于 2024-07-06 06:49:56 字数 1032 浏览 3 评论 0原文

从 2008 年 1 月开始在 MacBook Pro 上运行 OS X Leopard。

我曾经从包中运行 mysql 服务器,但随后 Rails 开始发出警告,要求我从 gem 安装 mysql: gem install mysql

它不起作用,我收到以下错误消息: 构建本机扩展。 这可能需要一段时间... 错误:安装 mysql 时出错: 错误:无法构建 gem 本机扩展。

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb 安装 mysql 检查 -lmysqlclient 中的 mysql_query()... 否 检查 -lm 中的 main()...是的 检查 -lmysqlclient 中的 mysql_query()... 否 检查 -lz 中的 main()...是的 ...剪断... Gem 文件将保留安装在 /Library/Ruby/Gems/1.8/gems/mysql-2.7 中以供检查。

结果记录到 /Library/Ruby/Gems/1.8/gems/mysql-2.7/gem_make.out

然后,根据朋友的建议,我尝试了一种不同的方法,并尝试遵循 http://hivelogic.com/articles/2007/11/installing-mysql-on-mac-操作系统-x 但现在在尝试运行 'mysql -u root' 时遇到了一个新问题

我得到的消息是:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

我用谷歌搜索了我的心,试图解决这两个问题,但感觉被困住了。 感谢您的阅读和帮助

Running OS X Leopard an MacBook Pro from Jan. 2008.

I used to run mysql server from a package but then rails started putting a warning that I should install mysql from gem: gem install mysql

It did not work, I got the following error message:
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb install mysql
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
... snip ...
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql-2.7 for inspection.

Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.7/gem_make.out

Then I tried a different way, upon a friend's advice and tried to follow the excellent instructions at http://hivelogic.com/articles/2007/11/installing-mysql-on-mac-os-x
but now ran into a new problem when trying to run 'mysql -u root'

The message I get is:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

I have googled my heart out trying to fix either problem and feel stuck. Thanks for reading and helping

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

三生路 2024-07-13 06:49:56

对于第一个问题 - 我想象 Ruby gem 正在安装 ruby​​ MySQL 接口/驱动程序,而不是 MySQL 服务器本身。 它可能不存在,或者位于标准脚本无法找到的位置。

第二条消息表明 MySQL 服务器未运行。 尝试再次启动它,或者检查任何日志/消息以获取有关它可能无法启动的原因的一些指示

To the first problem - I would imagine that Ruby gem is installing the ruby MySQL interface/drivers, not the MySQL server itself. It may be not present, or in a place the standard scripts can't find.

The second message indicates that the MySQL server is not running. Try starting it again, or examine any logs/messages for some indication as to why it might not be starting

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