So I am following a course on Lynda.com about IT Security. They were talking on the Least Privileges Principle, how users or processes should have the minimum amount of privileges for the minimum amount of time and it got me thinking, would it be of any use to dynamically assign and revoke privileges to a MySQL user.
So as an example, lets say that on a Saas website, there are two MySQL users. One is 'admin'@'localhost' and the other is 'worker'@'xxx'. The Worker user will hold no privileges until it signals the admin that it needs to write to the database. After the worker user is done, it signals again to the admin user that its job is finished and the admin user revokes the writing privilege. Making the worker user useless in the case it got compromised.