Terminal Command not working to connect to MySQL
12,415
Solution 1
add to your ~/.bash_profile
PATH=$PATH:/usr/local/mysql/bin:/usr/local/postgre/bin
export PATH
Then, in an existing terminal: source ~/.bash_profile
Solution 2
So, to get back to the question about MAMP, I'm going to try to simplify @SnapShot's answer.
Edit your bash profile (using whatever text editor you like, but in the example below it's using vi:
vi ~/.bash_profile
Then insert
export PATH=/Applications/MAMP/Library/bin:$PATH
That should work for you.
Author by
Leahcim
I'm pretty hopeless at programming but I'm enjoying trying to learn it (rails, php, javascript, jquery)... Backbone underscore twitterbootsrap http://jsfiddle.net/mjmitche/RRXnK/119/
Updated on June 22, 2022Comments
-
Leahcim almost 2 years
I'm working on a Mac 10.6.6 with MAMP installed.
Previously, I have been able to connect to mysql using this from my command line
mysql --host=127.0.0.1 --port=8889 --user=root -p
but now it is saying
-bash: mysql: command not found
Do you have any idea how I can fix this problem?
-
Leahcim about 13 yearsthanks, can you clarify a few things about your answer. (1) will this work with mysql that is installed via MAMP that is in the Applications folder? (2) does the last line in your answer (i.e. source~/.bash_profile) also go into the file?
-
Leahcim about 13 yearscurrently, my .bash_profile is totally blank. Is that a problem? Also, if you look at my amended OP, I have a pic of my file directory which shows that there are mysql folders inside other mysql folders, so I don't know which one to end the path at.
-
neocanable about 13 years/usr/local/your_mysql_directory_path/bin