SQL Server – Remove db_denydatawriter and db_denydatareader Role from Admin User

sql server

I have an AWS SQL Server instance, and I have accidentally given my user (and the only user I have access to) db_denydatawriter and db_denydatareader role on our primary database, which stops me from making any other changes to the db permissions to remove them.

Remembering this an AWS db instance, and the user I have locked out is the only user I have access to.

Surely it can't be this simple to ruin a database?

enter image description here

jcdbadmin is the user in question

Best Answer

If you need to reset your permissions for the master user to the defaults (dbo access in each database), you can reset the master user password from the AWS console and Apply Immediately to have changes take effect.

Here are the steps to do this:

  1. Go to the AWS Console
  2. Instance Actions -> Modify
  3. Under Settings type in a new password for the master password.
  4. Select Apply Immediately