> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_stat.md).

# mysql\_stat

## Syntax

```c
char * mysql_stat(MYSQL * mysql);
```

## Parameter

* `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).

## Description

`mysql_stat()` returns a string with the current server status for uptime, threads, queries, open tables, flush tables and queries per second.

{% hint style="info" %}
For a complete list of other status variables, you have to use the [SHOW STATUS](/docs/server/reference/sql-statements/administrative-sql-statements/show/show-status.md) SQL command.
{% endhint %}

## See Also

* [mysql\_get\_server\_info()](/docs/connectors/mariadb-connector-c/api-functions/mysql_get_server_info.md)

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