Documentation Home
MySQL 8.0 C API Developer Guide
Download this Manual
PDF (US Ltr) - 1.3Mb
PDF (A4) - 1.3Mb


5.4.63 mysql_refresh()

intmysql_refresh(MYSQL *mysql,              unsigned int options)

Description

Note

mysql_refresh() is deprecated and is subject to removal in a future version of MySQL. Instead, usemysql_real_query() ormysql_query() to execute aFLUSH statement.

This function flushes tables or caches, or resets replication server information. The connected user must have theRELOAD privilege.

Theoptions 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, likeFLUSH PRIVILEGES.

  • REFRESH_LOG

    Flush the logs, likeFLUSH LOGS.

  • REFRESH_TABLES

    Flush the table cache, likeFLUSH TABLES.

  • REFRESH_HOSTS

    Flush the host cache, likeFLUSH HOSTS.

  • REFRESH_STATUS

    Reset status variables, likeFLUSH STATUS.

  • REFRESH_THREADS

    Flush the thread cache.

  • REFRESH_SLAVE

    On a replica server, reset the source server information and restart the replica, likeRESET SLAVE.

  • REFRESH_MASTER

    On a source server, remove the binary log files listed in the binary log index and truncate the index file, likeRESET MASTER.

Return Values

Zero for success. Nonzero if an error occurred.

Errors