hi i have lost my aws database master pasword .i knew that how to reset rds password using below link https://aws.amazon.com/premiumsupport/knowledge-center/reset-master-user-password-rds/ but the problem is that i dint find any db instance in aws console. my app is running well. so there is backend db working properly .i have my privete key file . so can any one help how to reset my aws database master password,
- It sounds like your problem is not that you don't know how to reset the database password, but that you don't know how to find your database. Are you sure you are looking in the correct AWS region? Are you sure your database is running on RDS instead of on an EC2 server?Mark B– Mark B2020-08-20 13:31:56 +00:00Commented Aug 20, 2020 at 13:31
- Well, @MarkB is correct. You need to find out your DB before asking for password reset. You can check your Application Security Group and find out other SGs, once you get the Database SG, try figuring out which RDS/EC2 is using it. After that try resetting password.CK__– CK__2020-08-20 14:18:56 +00:00Commented Aug 20, 2020 at 14:18
- You can find out DB SG reference in EC2 SG console by putting Application SGs ID in search bar.CK__– CK__2020-08-20 14:20:53 +00:00Commented Aug 20, 2020 at 14:20
- @ChandanKumar i have only one ec2 instance .and two SG.but icant find my db using this any idea about it??Mohit-Tech– Mohit-Tech2020-08-21 03:35:36 +00:00Commented Aug 21, 2020 at 3:35
- 1Login into your EC2 instance and try thisCK__– CK__2020-08-21 06:35:25 +00:00Commented Aug 21, 2020 at 6:35
2 Answers
I think the below method can help you out with your problem.
First thing you can do is go into your application(which you mentioned that is running well) and check the connection string, you would have used DNS name or DNS endpoint for the same, using that you can find that out.
If it is DNS Name, then you can go and find in your hosted zone where it is mapped and the mapped DNS endpoint can tell you in which region and with which name it is launched in your AWS account.
If it is using DNS endpoint then it can tell you in which region and with which name it is launched in your AWS account.
Comments
Here are the steps to be followed:
Locate the MySQL configuration file using: $ mysql --help | grep -A 1 "Default options"
On Ubuntu 16, the file location is typically /etc/mysql/mysql.conf.d/mysqld.cnf
Edit the configuration file using: $ sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
Add skip-grant-tables under [mysqld] block and save the changes.
2.
Restart MySQL service using: sudo service mysql restart
Check MySQL service status: sudo service mysql status
3.
Login to mysql with: $ mysql -u root
And change the root password:
mysql> FLUSH PRIVILEGES;
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'MyNewPass';
Revert back the MySQL configuration file changes by removing skip-grant-tables line or commenting it with a # (hash).
Finally restart the MySQL service and you are good to go.


