int
mysql_refresh(MYSQL *mysql,
unsigned int options)
As of MySQL 5.7.11, mysql_refresh() is
deprecated and is subject to removal in a future version of
MySQL. Instead, use
mysql_query() or
mysql_real_query() to
execute a FLUSH statement.
This function flushes tables or caches, or resets replication
server information. The connected user must have the
RELOAD privilege.
The options argument is a bitmask composed
from any combination of the following values. Multiple values
can be OR'ed together to perform multiple operations with a
single call.
-
REFRESH_GRANTRefresh the grant tables, like
FLUSH PRIVILEGES. -
REFRESH_LOGFlush the logs, like
FLUSH LOGS. -
REFRESH_TABLESFlush the table cache, like
FLUSH TABLES. -
REFRESH_HOSTSFlush the host cache, like
FLUSH HOSTS. -
REFRESH_STATUSReset status variables, like
FLUSH STATUS. -
REFRESH_THREADSFlush the thread cache.
-
REFRESH_SLAVEOn a replica server, reset the source server information and restart the replica, like
RESET SLAVE. -
REFRESH_MASTEROn a source server, remove the binary log files listed in the binary log index and truncate the index file, like
RESET MASTER.
-
Commands were executed in an improper order.
-
The MySQL server has gone away.
-
The connection to the server was lost during the query.
-
An unknown error occurred.