-
Notifications
You must be signed in to change notification settings - Fork 272
mysql_init
Georg Richter edited this page Aug 14, 2018
·
2 revisions
mysql_init - Prepares and initializes a MYSQL structure
#include <mysql.h>
MYSQL *mysql_init(MYSQL *mysql);Prepares and initializes a MYSQL structure to be used with mysql_real_connect().
If an address of a MYSQL structure was passed as parameter, the structure will be initialized, if NULL was passed, a new structure will be allocated and initialized.
Notes:
- If parameter
mysqlis notNULLmysql_close() API function will not release the memory - Any subsequent calls to any function (except mysql_optionsv() will fail until mysql_real_connect() was called.
- Memory allocated by
mysql_init()must be freed with mysql_close().
The mysql_init() function returns an address of a MYSQL structure, or NULL in case of memory allcation error.
MariaDB Connector/C Reference