mariadb_reconnect(3)
π mariadb_reconnect β reconnects to a server π
okay bestie, welcome to mariadb_reconnect(3) from the MariaDB Connector/C manual, and no cap this one is lowkey a lifesaver when your connection justβ¦ ghosts you. let's get into it π«Ά
β¨ Name β¨
mariadb_reconnect β reconnects to a server π
πΈ Synopsis πΈ
#include <mysql.h>
my_bool mariadb_reconnect(MYSQL * mysql)
π¦ Description π¦
so like, mariadb_reconnect() tries to reconnect to a server in case the connection died β think timeout or literally any other error that yeeted your session into the void π. the way that it does this is it reuses the same credentials you already specified over in mysql_real_connect(3), so you don't have to re-type anything. it's giving "we're so back" energy π
π Return value π
- the function returns
0on success β - and a non-zero value on error π
note: it will return an error if the option MYSQL_OPT_RECONNECT wasn't set before. so fr fr, set that option first or this whole thing is not it π
π History π
mariadb_reconnect() was added in MariaDB Connector/C 3.0 β she's an icon, she's a legend, and she is the moment.
π See also π
that's the whole page, bestie β go forth and reconnect slayfully π§π
Version 3.4 of the MariaDB Connector/C docs, and yes mariadb_reconnect(3) is the main character of this page πβ¨ mwah, bye! π
π¦ 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