MySQL :: MySQL 8.4 C API Developer Guide :: 5.4.63 mysql_refresh() (original) (raw)
5.4.63 mysql_refresh()
int
mysql_refresh(MYSQL *mysql,
unsigned int options)
Description
This function flushes tables or caches, or resets replication server information. The connected user must have theRELOAD 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_GRANT
Refresh the grant tables, like FLUSH PRIVILEGES.REFRESH_LOG
Flush the logs, like FLUSH LOGS.REFRESH_TABLES
Flush the table cache, like FLUSH TABLES.REFRESH_STATUS
Reset status variables, like FLUSH STATUS.REFRESH_SLAVE
On a replica server, reset the source server information and restart the replica, like RESET REPLICA.REFRESH_MASTER
On a source server, remove the binary log files listed in the binary log index and truncate the index file, likeRESET BINARY LOGS AND GTIDS.
Return Values
Zero for success. Nonzero if an error occurred.
Errors
- CR_COMMANDS_OUT_OF_SYNC
Commands were executed in an improper order. - CR_SERVER_GONE_ERROR
The MySQL server has gone away. - CR_SERVER_LOST
The connection to the server was lost during the query. - CR_UNKNOWN_ERROR
An unknown error occurred.