Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
665 views
in Technique[技术] by (71.8m points)

ruby on rails - zsh: command not found: mysql

Trying to use MySQL for rails app and downloaded it from dev.mysql.com.

After successfully installing the package and seeing the option to start and stop the server from Preference Pane, if I go ahead and execute following command in my terminal

mysql --version

I end up with error as -

zsh: command not found: mysql

I've been looking for this error and understand that this has something to do with my $PATH variable and if display the value by echo $PATH I get following output -

/Library/Frameworks/Python.framework/Versions/3.4/bin:/Users/aniruddhabarapatre1/.rvm/gems/ruby-2.2.1/bin:/Users/aniruddhabarapatre1/.rvm/gems/ruby-2.2.1@global/bin:/Users/aniruddhabarapatre1/.rvm/rubies/ruby-2.2.1/bin:/usr/local/bin:/Users/aniruddhabarapatre1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin:/opt/ImageMagick/bin:/usr/local/MacGPG2/bin:/Users/aniruddhabarapatre1/.rvm/bin

How do I resolve this error to get Mysql up and running.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You should try paste this line to your environment variables

export PATH=${PATH}:/usr/local/mysql/bin/

Then try restart your environment variables with the following command

source ~/.zshrc              #If you use Oh-My-Zsh

source ~/.bashrc             #If you use Default Bash

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...