Mysql – How to REVOKE ALL ON db.table FROM user after GRANT ALL db.*

MySQL

I cannot revoke rights form a user which I gave him before

I gave a GRANT ALL ON [database].* TO 'user'@'%', because I need some user has access to all tables unless one of them. Then I wrote:
REVOKE ALL ON [database].table1 FROM 'user'@'%', but it says that: ERROR 1147 (42000): There is no such grant defined for user 'user' on host '%' on table 'table1';

Best Answer

Alas, I'm pretty sure that it is not directly possible. REVOKE seems to work only with the identical GRANT.

A messy workaround is to build GRANT statements for all the other tables with the aid if information_schema.tables, then execute them.

Suggest filing a bug at bugs.mysql.com. (But first, check to see there are already feature requests for it. Then click the 'me to' flag.)