void mysql_library_end(void);
#include <mysql.h> ... if (mysql_library_init(-1, NULL, NULL)) { ... } ... if (!mysql_thread_safe()) { ... } ... mysql_library_end(); ...