Search code examples
mysqlamazon-rds

Can't log in as master user [Using Amazon RDS]


I've been trying to log into mysql (version 8.0.35) using

mysql -h <endpoint> -u <master-username> -p

However, when I try to input the password, I get a 1045 access denied error. If I use an old password however, I am able to log in but the user I am on has no master permissions so I can't really do anything.

So far I've tried to work with the user logged in through the old password, however this user doesn't have any permissions despite the fact that it should be the master user (Using master username). If I try to reset the master password on the AWS RDS website, the website claims that it updated the master-credentials however when I try to log in with said credentials, I get the 1045 access denied error mentioned above.

To reiterate, I'm running the command below and then inputting my password.

mysql -h <endpoint> -u <master-username> -p

I am grabbing the master-username from AWS RDS's configuration tab of my database on the website.

Thank you in advance, hope I provided enough details!


Solution

  • Check how the master user is created. You can verify this using below query:

    SELECT user, host FROM mysql.user;
    
    1. If it is created using master@'%' user can connect from anywhere.
    2. If it is created as master@'localhost', can connect only from local host.
    3. If it is created with specific ip like master@'10.x.x.x`, the user connect only from the specific host.