---
name: "mysql_stat"
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_stat"
---

# mysql\_stat(3)

### Name

mysql\_stat - Returns current server status

### Synopsis

-

  ```
  #include <mysql.h>
  const char * mysql_stat(MYSQL * mysql);
  ```

### Description

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

### Parameter

- •

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

### Notes

For a complete list of other status variables, you have to use the \[show-status()\](SHOW STATUS\]\] SQL command.

### Return value

Returns a string representing current server status.

### See also

- •

  mysql\_get\_server\_info()
