You can call the mysql_reload() function request the server to reload the grant tables.
Syntax
int
mysql_reload(MYSQL *mysql)
Return values
0 is returned for an execution success, and a non-zero value is returned for errors.
Errors
CR_COMMANDS_OUT_OF_SYNC: Commands were executed in an improper order.CR_SERVER_GONE_ERROR: The connection to the OBServer was disconnected.CR_SERVER_LOST: The connection to the server was lost during the query.CR_UNKNOWN_ERROR: An unknown error occurred.
Notes
The logged-on user must have the RELOAD privilege.
This function is deprecated. Use mysql_real_query() or mysql_query() to issue an SQL FLUSH PRIVILEGES statement instead.