mysql_refresh()

2023-07-26 02:37:19  Updated

You can call the mysql_refresh() function to flush or reset tables or caches.

Syntax

int
mysql_refresh(MYSQL *mysql,
              unsigned int options)

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.

The options argument is a bitmask composed of any combination of the following values. Multiple values can be combined to perform multiple operations with a single call.

  • REFRESH_GRANT: flushes the grant tables, such as FLUSH PRIVILEGES.

  • REFRESH_LOG: flushes the logs, such as FLUSH LOGS.

  • REFRESH_TABLES: flushes the table cache, such as FLUSH TABLES.

  • REFRESH_HOSTS: flushes the host cache, such asFLUSH HOSTS.

  • REFRESH_STATUS: resets status variables, such as FLUSH STATUS.

  • REFRESH_THREADS: flushes the thread cache.

  • REFRESH_SLAVE: resets the source server information and restarts the replica on a replica server, such as RESET SLAVE.

  • REFRESH_MASTER: removes the binary log files listed in the binary log index and truncates the index file on a source server, such as RESET MASTER.

Contact Us