Mac OS X Lion - mysql: command not found

丶灬走出姿态 提交于 2019-12-14 03:16:45

问题


I have installed MySQL from this source, installation was successfully finished. But when I run in terminal which mysql, the output is empty. When mysql, the output is

-bash: mysql: command not found

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 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


回答1:


In the past I've had problems installing the mysql2 gem, so I wrote a little shell script to make my life easier:

#!/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:

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

and change mysql to mysql2.



来源:https://stackoverflow.com/questions/16949903/mac-os-x-lion-mysql-command-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!