5.7.7. When Privilege Changes Take Effect
When mysqld starts, it reads all grant table
contents into memory. The in-memory tables become effective for
access control at that point.
When the server reloads the grant tables, privileges for
existing client connections are affected as follows:
Table and column privilege changes take effect with the
client's next request.
Database privilege changes take effect at the next
USE db_name
statement.
Changes to global privileges and passwords take effect the
next time the client connects.
If you modify the grant tables indirectly using statements such
as GRANT
, REVOKE
, or
SET PASSWORD
, the server notices these
changes and loads the grant tables into memory again
immediately.
If you modify the grant tables directly using statements such as
INSERT
, UPDATE
, or
DELETE
, your changes have no effect on
privilege checking until you either restart the server or tell
it to reload the tables. To reload the grant tables manually,
issue a FLUSH PRIVILEGES
statement or execute
a mysqladmin flush-privileges or
mysqladmin reload command.
If you change the grant tables directly but forget to reload
them, your changes have no effect until you
restart the server. This may leave you wondering why your
changes do not seem to make any difference!