Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
    
That combined with a delete of the user via mysqladmin allowed me to get it into a better state. –  Kzqai Mar 2 '11 at 2:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.