-1

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.

2
  • i think you need an "h" between the dash and the hostname or else mysql thinks you want localhost Oct 5, 2013 at 0:23
  • ''@'localhost' error message specify that username is blank or anonymous, Please specify username of database using -u option of MySQL Oct 5, 2013 at 4:16

2 Answers 2

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
0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .