A long time missing feature in MySQL is temporarily blocking accounts: denying a user to log in, without affecting any other of her privileges.
There is no such privilege as ‘LOGIN’ in the grants table, as the ability to log in is the most basic one MySQL allows. This basic privilege is called USAGE.
I’ll present a hack around this, one which oak-block-account implements. Before presenting the hack, lets lay down some requirements:
- A user can be blocked from logging in to MySQL.
- Such a blocked user can later be ‘released’, re-enabling him to log in.
- It should be possible to determine if a certain user is currently blocked or not.