# mysql\_refresh

## Syntax

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

* `mysql` - a mysql handle, which was previously allocated by [mysql\_init()](/docs/connectors/mariadb-connector-c/api-functions/mysql_init.md) or [mysql\_real\_connect()](/docs/connectors/mariadb-connector-c/api-functions/mysql_real_connect.md).
* `options` - a bit masked composed integer. See below.

## 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.                            |
| REFRESH\_READ\_LOCK |                                                     |
| REFRESH\_FAST       |                                                     |

Returns zero on success, otherwise nonzero.

{% hint style="info" %}
To combine different values in the options parameter, use the OR operator '|'. The function `mysql_reload()` is an alias for `mysql_refresh()`.
{% endhint %}

{% @marketo/form formId="4316" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_refresh.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
