---
name: "mysql_refresh"
section: "3"
platform: "linux"
package: "mariadb"
version: "13.0.2-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/mysql_refresh"
---

# mysql\_refresh(3)

### Name

mysql\_refresh - flushes information on the server

### Synopsis

-

  ```
  #include <mysql.h>
  int mysql_refresh(MYSQL * mysql, unsigned int options);
  ```

### Description

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

### Parameters

- •

  `mysql` - a mysql handle, which was previously allocated by **[mysql\_init(3)](/mysql_init/3.md)** and connected by **[mysql\_real\_connect(3)](/mysql_real_connect/3.md)**.

- •

  `options` - a bit masked composed integer. See below.

`options` can be any combination of the following flags:

| | |
| --- | --- |
| 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. |

### Notes

- •

  To combine different values in the options parameter use the OR operator \`\|'.

- •

  `mysql_reload()` is an alias for mysql\_refresh().

### Return value

Returns zero on success, otherwise non zero.
