简体   繁体   English

Mac OS X Lion-mysql:找不到命令

[英]Mac OS X Lion - mysql: command not found

I have installed MySQL from this source , installation was successfully finished. 我已经从此安装了MySQL,安装成功完成。 But when I run in terminal which mysql , the output is empty. 但是,当我在终端运行mysql时 ,输出为空。 When mysql , the output is mysql时 ,输出为

-bash: mysql: command not found -bash:mysql:找不到命令

Also, I updated bundle and ran the app - the result: 另外,我更新了包并运行了该应用-结果:

/Users/adam/.rvm/gems/ruby-1.9.3-p385/gems/mysql2-0.3.11/lib/mysql2.rb:9:in `require': Incorrect MySQL client library version! This gem was compiled for 5.5.28 but the client library is 5.6.12. (RuntimeError)

Can I ask you for help how to tackle this issue? 请问您如何解决这个问题?

Thank you in advance 先感谢您

EDIT: I also tried to install the gem to the mysql directory, like 编辑:我也试图将gem安装到mysql目录中,例如

gem install mysql2 -- --with-mysql-config=/usr/local/Cellar/mysql/5.5.28/bin/mysql_config

But unfortunately the same - successfully installed, but when I run the app, still the same error 但不幸的是,相同-成功安装,但是当我运行该应用程序时,仍然是相同的错误

In the past I've had problems installing the mysql2 gem, so I wrote a little shell script to make my life easier: 过去,我在安装mysql2 gem时遇到了问题,所以我写了一些shell脚本来简化生活:

#!/bin/sh -x

env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

Try updating that with the path to your mysql_config: 尝试使用mysql_config的路径更新它:

/usr/local/Cellar/mysql/5.5.28/bin/mysql_config

and change mysql to mysql2 . 并将mysql更改为mysql2

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

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