RDS Mysql ERROR 1045 (28000): Access denied for user @IP (using password: YES)
Asked Answered
C

4

14

[This is not a duplicate question]

I have created a RDS MySQL instance with same Security Policy and under same VPC as my EC2 instance.

However when i am trying to access the Instance from EC2 machine i am getting error: ERROR 1045 (28000): Access denied for user 'User'@'IP' (using password: YES)

Not sure if i am missing Anything.

In MYSQL setup we can resolve this error with added Privileges for User on the IP.Not sure how can we resolve this since i am unable to access the Instance itself.

Anyone faced this issue before?.

I have followed the Document: http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/MySQL.Procedural.Importing.NonRDSRepl.html#MySQL.Procedural.Importing.Create.RDS.Database

Churchly answered 25/5, 2017 at 16:31 Comment(7)
This error is pretty straightforward. You're using the wrong username or password. If you're using the administrator account, you can reset the password in the console.Halloween
I am pretty sure the User and password we are using are correct.Churchly
Is this a new instance? Or is it an existing instance that formerly worked but now is no longer accessible? Are you in fact using the admin user credentials or a different user? Do any credentials work? More information is needed.Halloween
Michael, You were right at the first place.Thanks for the info.The user name and password i used was for instance.I never seen the user it created for Mysql DB which was different.Its working now.Churchly
@vipink. Can you please let me know which other user name and password you used. I am stuck with the same error. Thank You!Corniculate
I have faced similar issue. Not sure whether it's applicable to you. I was getting this error, when I was trying to connect with sudo privilege. I tried connecting again with same command except from normal ubuntu user from my ubuntu setup on ec2 instance; and it worked.Virtuosity
i created a "duplicate" image to recover lost PEM. now the new one will not connect to the DB. I updated the HOST in the user table on the DB but it still will not connect.Fra
T
7
mysql -h dandy-dbamazonaws.com[...] -u root -p 

-h - put your endpoint
-u - username you set for your local mysql (root in my case). Don't confuse it with instance name
-p - after you hit 'enter' enter the password for your instance (the one you set up during instance creation)

hope it will work! that's how I resolved this issue

Torp answered 9/7, 2018 at 10:14 Comment(1)
You can find the Master username (you can use it for -u parameter) by clicking on your RDS instance name > tab Configurations;Northward
P
3

Maybe late but I had the same problem today.

  1. Confirm the MasterUsername, with the AWS CLI running aws rds describe-db-instances or in the web console, showing the cluster details on the configuration tab.
  2. Confirm the password, if you are using linux consoles (bash) some some characters may be problematic like # or !.
  3. If you are using ssl connection you can't use --ssl-mode=DISABLED. You have to use --ssl-mode=VERIFY_CA (if you are connecting to endpoint) or --ssl-mode=VERIFY_IDENTITY (OR VERIFY_CA) if are connecting to server endpoint.
Putty answered 5/4, 2019 at 15:3 Comment(0)
S
0

The goofy ones always get you: I experienced the same problem after changing the master password but let slip the important fact that by default changes don't take effect until the next maintenance window.

In my scenario I was connecting to an Aurora MYSQL serverless v2

  • Check you are connecting to the cluster writer instance endpoint
  • Modify the master password and apply changes immediately
Skepful answered 31/12, 2022 at 22:32 Comment(0)
S
0

All my security groups were configured correctly, but I had to issue the mysql command as a superuser, like this to connect from the CLI

sudo mysql -uMYADMIN -hMYHOST MYDATABASE -p

Once I added the sudo it worked.

Subdivision answered 30/5 at 0:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.