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.
- Client applications may cache the database name.
- This effect may not be visible to them without actually changing to a different database or executing a
FLUSH PRIVILEGES statement.
- Changes to global privileges and passwords take effect the next time the client connects.
- If the grant tables are modified indirectly by using statements such
as
GRANT, REVOKE, or
SET PASSWORD, the server notices these
changes and loads the grant tables into memory again
immediately.
- If the grant tables are modified directly using statements such as
INSERT, UPDATE, or
DELETE, changes have no effect on
privilege checking until either a server restart or a
reload of the tables.
- To reload the grant tables manually,
issue a
FLUSH PRIVILEGES statement or execute
a mysqladmin flush-privileges or
mysqladmin reload command.
- If the grant tables are not reloaded, changes have no effect until a server restart.
What are some typical error messages?
© 2007 John Michael Pierobon
Notes