For the complete documentation index, see llms.txt. This page is also available as Markdown.

mysql_refresh

mysql_refresh flushes server-side caches and state using a bitmask of options such as REFRESH_GRANT, REFRESH_LOG, REFRESH_TABLES, and REFRESH_HOSTS.

Syntax

int mysql_refresh(MYSQL * mysql,
  unsigned int options);

Parameters

Description

Flushes different types of information stored on the server. The bit-masked parameter options specify which kind of information will be flushed.

options can be any combination of the following:

Option
Description

REFRESH_GRANT

Refresh grant tables.

REFRESH_LOG

Flush logs.

REFRESH_TABLES

Flush table cache.

REFRESH_HOSTS

Flush host cache.

REFRESH_STATUS

Reset status variables.

REFRESH_THREADS

Flush thread cache.

REFRESH_SLAVE

Reset master server information and restart slaves.

REFRESH_MASTER

Remove binary log files.

Return Value

Returns zero on success, otherwise nonzero.

  • To combine different values in the options parameter, use the OR operator '|'.

  • The function mysql_reload() is an alias for mysql_refresh().

This page is: Copyright © 2026 MariaDB. All rights reserved.

spinner

Last updated

Was this helpful?