0

I am not able to access mysql on amazon AWS EC2 instance. I was able to access with same password yesterday night but when I today morning opened my MySQLWorkBench I could not connect to my MySql server on EC2 instance, I logged in to EC2 server and there also I could not connect

$ mysql -u root -p
<Gave My Password>

and I got error

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

I am giving the correct password

Its my Production server I am too worried :(

James Z
  • 12,209
  • 10
  • 24
  • 44
Sharanabasu Angadi
  • 4,304
  • 8
  • 43
  • 67
  • possible duplicate of [MySQL ERROR 1045 (28000): Access denied for user 'bill'@'localhost' (using password: YES)](http://stackoverflow.com/questions/10299148/mysql-error-1045-28000-access-denied-for-user-billlocalhost-using-passw) – Zelldon Jun 19 '15 at 06:56
  • @ Zelldon Thats different question, Now I am not able to login to mysql only. – Sharanabasu Angadi Jun 19 '15 at 07:05
  • Same as he cant login with the user bill i think :) – Zelldon Jun 19 '15 at 07:06
  • yeah @zelldon, but he is able to login as root and he solved it. here I have only one user root and I am not able to login as root only – Sharanabasu Angadi Jun 19 '15 at 07:25

2 Answers2

0

I think this problem is related to forget permission giving for access. Please try with grant all privileges using below mysql code:

//Login into shell
mysql> $ mysql -u root -p
<give your password>

//Grant full permissions.
mysql> GRANT ALL PRIVILEGES ON * . * TO 'root'@'localhost' IDENTIFIED BY 'give your password';

//To tell the server to reload the grant tables, perform a flush-privileges operation. This can be done by issuing a FLUSH PRIVILEGES statement so call it.
mysql> FLUSH PRIVILEGES

This would resolve your issue.

AddWeb Solution Pvt Ltd
  • 21,025
  • 5
  • 26
  • 57
0

The problem may be due to security group associated with the Amazon RDS instance.

Do the following things:

1) Go to the security group associated with the Amazon rds instance.

2) Check the inbound rule. Ensure that the your machine ip is included in the inbound rule as shown

enter image description here

on selecting "My Ip" option in Source your ip address will be autofilled.

This type of issue occures when your machine used to connect Amazon RDS instance acquires dynamic ip address via DHCP

Domain
  • 11,562
  • 3
  • 23
  • 44