You can call the mysql_dump_debug_info() function to instruct the server to write debugging information to the error log.
Syntax
int
mysql_dump_debug_info(MYSQL *mysql)
Return values
0 is returned for an execution success, and a non-zero value is returned if an error occurred.
Errors
CR_COMMANDS_OUT_OF_SYNC: Commands were executed in an improper order.CR_SERVER_GONE_ERROR: The connection to the OBServer was disconnected.CR_SERVER_LOST: The connection to the server was lost during the query.CR_UNKNOWN_ERROR: An unknown error occurred.
Notes
When using mysql_dump_debug_info(), the logged-on user must have the SUPER privilege.