Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Looking link to learn about using mysql Terminal commands. I have MAMP (LAMP for macintosh) installed in my computer. I'm trying to connect to a remote mysql database using Terminal application on my computer but I get an error message.

What I do is:

  1. Open Terminal app
  2. Go to mysql installation folder with this line: /Applications/MAMP/Library/bin/mysql.
  3. Then I try to connect to remote database with this line: mysql -h -u user_name -p database_name

But I get this error message:

'ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near -h -u user_name -p database_name' at line 1

Message says I have a error in my SQL syntax but I see no errors in it. What am I missing here?

share|improve this question
up vote 1 down vote accepted

Step 3 isn't a command you submit in the MySQL console, but is a mysql program call with parameters. After step 2, you're already connected to your local/default instance.

Replace steps 2 and 3 with

/Applications/MAMP/Library/bin/mysql -h -u user_name -p database_name
share|improve this answer
works! thanks daniel. – chefnelone Jul 7 '11 at 7:43

Your Answer


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.