mysql_dump_debug_info()
int mysql_dump_debug_info(MYSQL *mysql)
Use this function to write debugging information about the current connection to the MySQL server’s log file. It returns 0 if successful and a nonzero value if not. The user must have administrative privileges. Here is an example:
...
if(!mysql_dump_debug_info(mysql))
{ printf("Debugging Info. Written. \n"); }
...