MySQl : Flush Privileges statement

When mysqld starts the privileges like database, table, column and user privileges loaded into memory. Database, table and column privileges take into effect once. But the user privileges get effect when the user connects next time.

Use of Flush Privileges

It informs the server to re-read the grant tables. Normally we use this statement

1. After adding or updating any privilege using the insert, update or delete. It is necessary to use flush privileges statement to inform server to reload the privileges.

2. After updating or adding the user to the user table directly, need to use the flush privileges to notify the server to re-read the grant tables.

Flush Privileges and Mysqladmin flush-privileges are same.

After reload when the privileges get into effect

1. Table and column privilege changes get effected on next request.

2. Database privilege changes get effected, when we issue use database statement.

3. Global privilege, password changes get effected only next client request.

Your changes to privilege are not getting effected?

Did you execute flush privileges statement. If you not executed flush privileges, execute and see.

Still not getting use show grant statement and check it. If it exists then try restart the server, now it will.