mysql_errno(3)
π mysql_errno β bestie edition
okay so this is the manual page for mysql_errno from the MariaDB Connector/C library, and honestly? it's giving "short but essential." no cap. let's get into it π«Ά
β¨ Name β¨
mysql_errno β returns the last error code for the most recent function call. that's it. that's the whole job. she's simple, she's iconic, she tells you what went wrong π
πΈ Synopsis πΈ
#include <mysql.h>
unsigned int mysql_errno(MYSQL * mysql);
like yes, that's the whole thing. she takes one pointer and hands you back an unsigned int. slay π
π¦ Description π¦
so basically, mysql_errno() returns the last error code for the most recent function call that can succeed or fail. meaning: if the last thing you asked the library to do had the option of flopping, this is where you find out what kind of flop it was π
and here's the part bestie, listen up: zero means no error occurred. a 0 is not a code, it's a vibe check that you PASSED. periodt. β¨
π Parameter π
mysqlβ a connection identifier, which was previously allocated bymysql_init(3)and connected bymysql_real_connect(3). so like, you can't just roll up with any random pointer, she needs a connection that's been properly set up first. main character energy only π«Ά
π Notes π
- client error codes are listed in the
errmsg.hheader file π, and server error codes are listed in themysqld_error.hheader file of the server source distribution π. so if you're staring at a number like "what does this MEAN," go look it up in one of those two files β client-side errors live in one, server-side errors live in the other. iykyk π§
π See also π
like the whole error-handling friend group. go read them too, they're obsessed with each other π
lowkey reminder: 0 = all good, anything else = something happened and you should go read the code. no guessing, bestie, the header files are RIGHT THERE π
kisses, and remember β this is Version 3.4 of the MariaDB Connector/C manual, brought to you with so much love πβ¨ mwah π
π¦ 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