For the complete documentation index, see llms.txt. This page is also available as Markdown.

mysql_error

mysql_error returns the error message string for the most recent failed MariaDB Connector/C function call, or an empty string if no error occurred.

Syntax

const char * mysql_error(MYSQL * mysql);

Parameter

Description

Returns the last error message for the most recent function call that can succeed or fail. If no error occurred an empty string is returned.

  • Client error codes are listed in errmsg.h header file, server error codes are listed in mysqld_error.h header file of the server source distribution.

  • Client error messages can be obtained by calling mariadb_get_infov() and passing the parameter MARIADB_CLIENT_ERRORS

See Also

This page is: Copyright © 2026 MariaDB. All rights reserved.

spinner

Last updated

Was this helpful?