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.

Share:
12,415
Leahcim
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, 2022

Comments

  • Leahcim
    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? mysql directory

  • Leahcim
    Leahcim about 13 years
    thanks, 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
    Leahcim about 13 years
    currently, 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
    neocanable about 13 years
    /usr/local/your_mysql_directory_path/bin