mysql_stat(3)

πŸ“¦
version 13.0.2 Β· 4 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸŽ€ NAME πŸŽ€

mysql_stat β€” bestie, this one hands you the server's current status, like a little vibe check for your MariaDB server πŸ’…

It lives in the MariaDB Connector/C family, and the page you're reading is mysql_stat(3) ✨


🌸 SYNOPSIS 🌸

#include <mysql.h>

const char * mysql_stat(MYSQL * mysql);

πŸ’– DESCRIPTION πŸ’–

okay so mysql_stat() gives you back a string stuffed with the server's current status. Specifically it's serving up:

  • uptime
  • threads
  • queries
  • open tables
  • flush tables
  • queries per second

that's the whole menu, no cap πŸ“


πŸ¦‹ PARAMETER πŸ¦‹

  • mysql β€” a mysql handle 🫢 which you already got earlier from mysql_init(3) and then actually connected with mysql_real_connect(3). Don't hand it a rando pointer, she needs a real one πŸ’€

✨ NOTES ✨

if you want the complete list of other status variables (because this function is lowkey only showing you a handful), you gotta go run the SHOW STATUS SQL command yourself πŸ‘‘

not me reminding you that mysql_stat() is not the full picture β€” it's giving highlight reel, not the whole documentary πŸ“Έ

πŸ‘‘ RETURN VALUE πŸ‘‘

Returns a string representing the current server status. that's it, that's the tea β˜•


🌈 SEE ALSO 🌈

  • mysql_get_server_info()

and that's the page, bestie!! this was mysql_stat(3) from Version 3.4 of the MariaDB Connector/C docs β€” tysm for reading, mwah, go check your server status, slay πŸ’–πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from