I was wondering if it would work to create a user, grant him all
privileges on all databases (so make him a superuser) and then
revoke all permissions from one particular database.
I knew that this would be quite a complicated process inside the
mysql privilege database. All the global privileges would have to
be set to 'N' and MySQL would have to insert a new record for
each existing database (except the one where the privileges are
revoked) to the db table to grant the privileges at database
level instead of globally. So I tried it out:
mysql> CREATE USER testuser@localhost[Read more]
-> IDENTIFIED BY 'abc123';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL ON *.*
-> TO testuser@localhost
-> WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)
mysql> REVOKE ALL ON test.*
-> FROM testuser@localhost;
ERROR 1141 (42000): There is no such …