Negative restrictions in MySQL 4.1.22?
Posted on 2007-10-16
This might be a though nut to crack. . .
Our <application>, mostly PHP based, uses a single MySQL user account to both read and write data to our master database server, which in turn sends it to its slaves, you know, your standard replication setup.
Now, I have some tables I want to restrict write access to, but the MySQL user automatically has access to everything because of its GRANT ALL ON *.* TO user@host privilege.
I have thought about chmod-ing the table, but it isn't very practical since it is on a different server.
The other option, defining privileges of each of the 20K+ tables in our databases is not only very daunting, but we'd need to employ an extra hand just to maintain those privs, that, and they don't work very well with temporary tables (with uniqid names)
So, is there a way to do in MySQL
GRANT ALL ON *.* EXCEPT thisorthadatabas TO user@...
Or another way you can think of revoking write privilege to the user for this particular database.