mysql_refresh(3)
β¨ 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 bymysql_init(3)and connected bymysql_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
optionsparameter, use the OR operator|. literally just stack them with pipes, she eats. π mysql_reload()is an alias formysql_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
- alpine 3.22: mariadb-doc 11.4.13-r0 Β· GPL-2.0-or-later
- alpine 3.23: mariadb-doc 11.4.13-r0 Β· GPL-2.0-or-later
- alpine 3.24: mariadb-doc 11.8.9-r0 Β· GPL-2.0-only
- arch rolling: mariadb 13.0.2-2 Β· GPL-2.0-only
- arch rolling: mariadb-lts 12.3.3-2 Β· GPL-2.0-only
- centos-stream 10: mariadb-connector-c-doc 3.4.4-2.el10 Β· LGPL-2.1-or-later
- debian trixie: libmariadb-dev 1:11.8.6-0+deb13u1 Β· GPL-2.0-only
- fedora 43: mariadb-connector-c-doc 3.4.5-2.fc43 Β· LGPL-2.1-or-later AND PHP-3.0 AND PHP-3.01
- fedora 43: mariadb-connector-c-doc 3.4.9-2.fc43 Β· LGPL-2.1-or-later AND PHP-3.0 AND PHP-3.01 AND LicenseRef-Fedora-Public-Domain
- fedora 44: mariadb-connector-c-doc 3.4.8-3.fc44 Β· LGPL-2.1-or-later AND PHP-3.0 AND PHP-3.01
- fedora 44: mariadb-connector-c-doc 3.4.9-2.fc44 Β· LGPL-2.1-or-later AND PHP-3.0 AND PHP-3.01 AND LicenseRef-Fedora-Public-Domain
- nixpkgs unstable: mariadb-server 11.8.8
- opensuse-leap 16.0: libmariadb-devel 3.4.9-160000.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libmariadb-devel 3.4.9-160000.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libmariadb-devel 3.4.9-160000.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libmariadb-devel 3.4.9-160000.1.1 Β· LGPL-2.1-or-later
- ubuntu questing: libmariadb-dev 1:11.8.3-1build1
- ubuntu resolute: libmariadb-dev 1:11.8.6-5 Β· GPL-2.0-only
- ubuntu resolute: libmariadb-dev 1:11.8.6-5ubuntu0.1 Β· GPL-2.0-only
- ubuntu stonking: libmariadb-dev 1:11.8.9+ds-4ubuntu2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms