0

I have set up some table specific grants in MySQL, but when I log on as that MySQL-user it still has full access to all tables. I'd like to wipe all the GRANTs and start them over.

I'm running a Debian Linux server, using command line commands like:

GRANT INSERT on database.someTable TO 'everyone'@'localhost';

(multiplied times 30 or so.)

Trying to revoke the grants using the single command below just yields some error saying that there wasn't a grant of that type to remove:

REVOKE all on database.* FROM 'everyone'@'localhost';

Do I have to try to reverse engineer the grants and REVOKE them each individually?

Kzqai
  • 1,278
  • 4
  • 18
  • 32

1 Answers1

1

SHOW GRANTS FOR 'user'@'localhost'; will show you all of the grant commands applied for a given user, you can then change them to revokes to reverse them.

Generally a good idea to run a FLUSH PRIVILEGES; before testing, as well.

Shane Madden
  • 114,520
  • 13
  • 181
  • 251
  • That combined with a delete of the user via mysqladmin allowed me to get it into a better state. – Kzqai Mar 02 '11 at 02:23