Restore Privileges and Access to Master User in RDS to use correctly and access database

0

I was connected to mysql using command line with AWS credentials. I was trying to add some privileges to be able to run a sql script file into the database. I followed some information and run the following query GRANT USAGE ON *.* TO masterusername@'ip' IDENTIFIED BY 'my_secret'; GRANT ALL ON database.* TO masterusername@'ip'; And suddenly I was not able to connect to the database, it's telling me I have no access to such database; My application is running fine but when I try to connect to the db via mysql command line I'm not able to connect. This is a glance to the grants I have but I think I might tried to reset them, but not sure how. SELECT USER(), CURRENT_USER(); information, prior and after the change Before:

+-------------------+------------------+
| USER()            | CURRENT_USER()   |
+-------------------+------------------+
| masterusername@ip | masterusername@% |
+-------------------+------------------+

After:

+----------------------+----------------------+
| USER()               | CURRENT_USER()       |
+----------------------+----------------------+
| masterusername@ip    | masterusername@ip    |
+----------------------+----------------------+

I want to change it back but seems I have no longer privileges cause of the @ip part of the connection I need to restore it to what it was

Enrique
gefragt vor 4 Monaten305 Aufrufe
2 Antworten
0

You can restore the password with this api

 aws rds modify-db-instance --master-user-password
AWS
MODERATOR
philaws
beantwortet vor 4 Monaten
profile picture
EXPERTE
überprüft vor 4 Monaten
  • Do you know if this will restore the config for the user? I can access with the password to the mysql command line but it does not allow me to connect to the db I want.

  • There are 2 users matching the master username; only resetting the the one not tied to a specific host @philaws

0

This does not reset the grants for the root user...

beantwortet vor 3 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen