Search Results
https://dev.mysql.com/doc/c-api/8.4/en/mysql-real-connect-dns-srv.html
Return Values A MYSQL* connection handler if the connection was successful, NULL if the connection was unsuccessful. MYSQL * mysql_real_connect_dns_srv(MYSQL *mysql, const char *dns_srv_name, const char *user, const char *passwd, const char *db, ...
https://dev.mysql.com/doc/c-api/8.4/en/mysql-real-connect-nonblocking.html
The two functions differ as follows: mysql_real_connect() returns a connection handler or NULL. enum net_async_status mysql_real_connect_nonblocking(MYSQL *mysql, const char *host, const char *user, const char *passwd, const char *db, unsigned int ...
https://dev.mysql.com/doc/c-api/8.4/en/mysql-set-character-set.html
Example MYSQL mysql; mysql_init(&mysql); if (!mysql_real_connect(&mysql,"host","user","passwd","database",0,NULL,0)) { fprintf(stderr, "Failed to connect to database: Error: %s\n", mysql_error(&mysql)); } if (!mysql_set_character_set(&mysql, ... int ...
https://dev.mysql.com/doc/c-api/8.4/en/mysql-set-local-infile-handler.html
Write the message as a null-terminated string, at most error_msg_len−1 bytes long. void mysql_set_local_infile_handler(MYSQL *mysql, int (*local_infile_init)(void **, const char *, void *), int (*local_infile_read)(void *, char *, unsigned int), ...
https://dev.mysql.com/doc/c-api/8.4/en/mysql-stat.html
const char * mysql_stat(MYSQL *mysql) Description Returns a character string containing information similar to that provided by the mysqladmin status command. This includes uptime in seconds and the number of running threads, questions, reloads, ...
https://dev.mysql.com/doc/c-api/8.4/en/mysql-stmt-error.html
const char * mysql_stmt_error(MYSQL_STMT *stmt) Description For the statement specified by stmt, mysql_stmt_error() returns a null-terminated string containing the error message for the most recently invoked statement API function that can succeed ...Either of these two tests can be used to check for an error: if(*mysql_stmt_errno(stmt)) { // an error occurred } if (mysql_stmt_error(stmt)[0]) { // an error occurred } If the failed statement API function was mysql_stmt_close(), do not call mysql_stmt_error() to obtain error information because mysql_stmt_close() makes the statement handler ...
https://dev.mysql.com/doc/c-api/8.4/en/mysql-stmt-init.html
MYSQL_STMT * mysql_stmt_init(MYSQL *mysql) Description Creates and returns a MYSQL_STMT handler. The handler should be freed with mysql_stmt_close(), at which point the handler becomes invalid and should no longer be used. See also Section 6.2, ...
https://dev.mysql.com/doc/c-api/8.4/en/mysql-stmt-result-metadata.html
MYSQL_RES * mysql_stmt_result_metadata(MYSQL_STMT *stmt) Description mysql_stmt_result_metadata() is used to obtain result set metadata for a prepared statement. Its use requires that the statement when executed by mysql_stmt_execute() does produce ...
https://dev.mysql.com/doc/c-api/8.4/en/mysql-stmt-send-long-data.html
bool mysql_stmt_send_long_data(MYSQL_STMT *stmt, unsigned int parameter_number, const char *data, unsigned long length) Description Enables an application to send parameter data to the server in pieces (or “chunks”). It can be called multiple ...
https://dev.mysql.com/doc/c-api/8.4/en/mysql-stmt-store-result.html
You can detect whether the statement produced a result set by checking whether mysql_stmt_result_metadata() returns NULL. int mysql_stmt_store_result(MYSQL_STMT *stmt) Description Result sets are produced by calling mysql_stmt_execute() to executed ...