Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

I am trying to login to MySQL server using *nix shell prompt, following is my command :

$ mysql **********

(where the asterisks are my ID)

I am getting following error :

Access denied for user ''@'localhost' to database

Should I be specifying a username? If so, a username from where? And the password? I already created Security Groups, but I'm not sure how to relate them to logging onto the server.

share|improve this question
i think you need an "h" between the dash and the hostname or else mysql thinks you want localhost – user16081-JoeT Oct 5 '13 at 0:23
''@'localhost' error message specify that username is blank or anonymous, Please specify username of database using -u option of MySQL – Abhijeet Kasurde Oct 5 '13 at 4:16

To connect to a DB instance using the MySQL

Type the following command at a command prompt to connect to a DB instance using the MySQL monitor; substitute the DNS name for your DB instance.

  PROMPT> mysql -h -P 3306 -u mymasteruser -p
share|improve this answer

1)By default, a MySQL installation has an anonymous user,may be Amazon has droped anonymous user

2)in MySQL,localhost,ip, are differ,but by default,MySQL login with localhost,you might as well try -h

share|improve this answer

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.