mysql_refresh(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

✨ mysql_refresh β€” the glow-up your server info needed ✨

okay bestie, gather round πŸ’– this is a page from the MariaDB Connector/C manual, and today's main character is mysql_refresh(3) β€” the function that flushes information on the server. it's giving "spring cleaning but for caches". no cap. 🧹✨


🌸 SYNOPSIS 🌸

#include <mysql.h>

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

like, that's the whole vibe. one include, one call. iconic. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so what does it do?? it flushes different types of information stored on the server. that's it, that's the girl. πŸ’«

the parameter options is a bit-masked integer, and it tells the server which kind of information is gonna get flushed. you pick the flavours, she does the work. periodt. πŸ‘‘


πŸŽ€ PARAMETERS πŸŽ€

  • mysql β€” a mysql handle, which was previously allocated by mysql_init(3) and connected by mysql_real_connect(3). so like, she has to already exist and already be connected, ok?? don't come at her with a fresh uninitialized pointer, that's not the move. πŸ™ˆ
  • options β€” a bit masked composed integer. see below, bestie πŸ‘‡

options can be any combination of the following flags:

  • 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 |. literally just stack them with pipes, she eats. πŸ“
  • mysql_reload() is an alias for mysql_refresh(). same girl, different name. iykyk. ✨

🌈 RETURN VALUE 🌈

Returns zero on success, otherwise non zero. so 0 = slay, anything else = something's up, go check yourself before you wreck yourself. πŸ’€


okay and that's the whole page!! every single flag, every single alias, every single return value β€” nothing left out, nothing made up. she's thorough AND cute. no cap. πŸ‘‘πŸ’–

this has been Version 3.4 of the mysql_refresh(3) page from the MariaDB Connector/C crew β€” mwah, love u, go flush responsibly πŸŽ€πŸ¦‹πŸ’…

πŸ“¦ where this page comes from