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 am trying to login to MySQL server using *nix shell prompt, following is my command :

$ mysql ********** -east-1.rds.amazonaws.com:3306

(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 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

2 Answers 2

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 myinstance.mydnsnameexample.rds.amazonaws.com -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,127.0.0.1 are differ,but by default,MySQL login with localhost,you might as well try -h

share|improve this answer

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.