Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have MySql installed as part of MAMP on my MacBook Pro OS X 10.6.4. But Terminal responds to the mysql command with:

-bash: mysql: command not found

This:

sudo find / -name "mysql"

brings this:

/Applications/MAMP/db/mysql
/Applications/MAMP/db/mysql/mysql
/Applications/MAMP/Library/bin/mysql
/Applications/MAMP/tmp/mysql

Even when I try to launch mysql from those directories, it's not happening. What's up here?

share|improve this question

migrated from stackoverflow.com May 26 '11 at 0:45

This question came from our site for professional and enthusiast programmers.

add comment

1 Answer 1

up vote 0 down vote accepted

You want:

/Applications/MAMP/Library/bin/mysql

Which I just tried myself and it worked. You will of course need to pass it the proper login parameters as with standard mysql:

$ /Applications/MAMP/Library/bin/mysql -u root -h localhost -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.44 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 

You can also use a symlink to make things easier as described here:

http://www.aschroder.com/2009/03/how-to-use-the-mamp-mysql-command-line-client-in-a-terminal/

EDIT

An alternative is to install the official MySQL instead of using MAMP's version:

http://developer.apple.com/internet/opensource/osdb.html

share|improve this answer
    
Thanks for your help. Saved my day! Well wishes are now being sent to you across the aether. –  user77510 May 26 '11 at 23:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.