Documentation Home
MySQL 8.0 C API Developer Guide
Download this Manual
PDF (US Ltr) - 1.3Mb
PDF (A4) - 1.3Mb


MySQL 8.0 C API Developer Guide  /  C API Basic Interface  /  C API Basic Function Reference

5.3 C API Basic Function Reference

The following table summarizes the functions available in the C API basic interface. For greater detail, see the descriptions in Section 5.4, “C API Basic Function Descriptions”.

Table 5.1 C API Basic Interface Functions

Name Description Introduced Deprecated
mysql_affected_rows() Number of rows changed/deleted/inserted by last UPDATE, DELETE, or INSERT statement
mysql_autocommit() Set autocommit mode
mysql_bind_param() Define query attributes for next statement executed 8.0.23
mysql_change_user() Change user and database on an open connection
mysql_character_set_name() Default character set name for current connection
mysql_close() Close connection to server
mysql_commit() Commit transaction
mysql_connect() Connect to MySQL server Yes
mysql_create_db() Create database Yes
mysql_data_seek() Seek to arbitrary row number in query result set
mysql_debug() Perform DBUG_PUSH with given string
mysql_drop_db() Drop database Yes
mysql_dump_debug_info() Cause server to write debug information to error log
mysql_eof() Determine whether last row of result set has been read Yes
mysql_errno() Error number for most recently invoked MySQL function
mysql_error() Error message for most recently invoked MySQL function
mysql_escape_string() Escape special characters in string for use in SQL statement
mysql_fetch_field() Type of the next table field
mysql_fetch_field_direct() Table field type for given field number
mysql_fetch_fields() Return array of all field structures
mysql_fetch_lengths() Return lengths of all columns in current row
mysql_fetch_row() Fetch next result set row
mysql_field_count() Number of result columns for most recent statement
mysql_field_seek() Seek to column within result set row
mysql_field_tell() Field position for last mysql_fetch_field() call
mysql_free_result() Free result set memory
mysql_free_ssl_session_data() Dispose of session data handle from last mysql_get_ssl_session_data() call 8.0.29
mysql_get_character_set_info() Information about default character set
mysql_get_client_info() Client version (string)
mysql_get_client_version() Client version (integer)
mysql_get_host_info() Information about the connection
mysql_get_option() Value of a mysql_options() option
mysql_get_proto_info() Protocol version used by the connection
mysql_get_server_info() Server version number (string)
mysql_get_server_version() Server version number (integer)
mysql_get_ssl_cipher() Current SSL cipher
mysql_get_ssl_session_data() Return session data for SSL-enabled connection 8.0.29
mysql_get_ssl_session_reused() Whether a session is reused 8.0.29
mysql_hex_string() Encode string in hexadecimal format
mysql_info() Information about most recently executed statement
mysql_init() Get or initialize a MYSQL structure
mysql_insert_id() ID generated for an AUTO_INCREMENT column by previous statement
mysql_kill() Kill a thread Yes
mysql_library_end() Finalize MySQL C API library
mysql_library_init() Initialize MySQL C API library
mysql_list_dbs() Return database names matching regular expression
mysql_list_fields() Return field names matching regular expression
mysql_list_processes() List of current server threads
mysql_list_tables() Return table names matching regular expression
mysql_more_results() Check whether more results exist
mysql_next_result() Return/initiate next result in multiple-result execution
mysql_num_fields() Number of columns in result set
mysql_num_rows() Number of rows in result set
mysql_options() Set option prior to connecting
mysql_options4() Set option prior to connecting
mysql_ping() Ping server
mysql_query() Execute statement
mysql_real_connect() Connect to MySQL server
mysql_real_connect_dns_srv() Connect to MySQL server using DNS SRV record 8.0.22
mysql_real_escape_string() Encode special characters in statement string
mysql_real_escape_string_quote() Encode special characters in statement string accounting for quoting context
mysql_real_query() Execute statement
mysql_refresh() Flush or reset tables and caches
mysql_reload() Reload grant tables Yes
mysql_reset_connection() Reset the connection to clear session state
mysql_reset_server_public_key() Clear cached RSA public key from client library
mysql_result_metadata() Whether a result set has metadata 8.0.13
mysql_rollback() Roll back transaction
mysql_row_seek() Seek to row offset in result set
mysql_row_tell() Current position within result set row
mysql_select_db() Select database
mysql_server_end() Finalize MySQL C API library
mysql_server_init() Initialize MySQL C API library
mysql_session_track_get_first() First part of session state-change information
mysql_session_track_get_next() Next part of session state-change information
mysql_set_character_set() Set current connection default character set
mysql_set_local_infile_default() Set LOAD DATA LOCAL handler callbacks to default values
mysql_set_local_infile_handler() Install application-specific LOAD DATA LOCAL handler callbacks
mysql_set_server_option() Set option for current connection
mysql_shutdown() Shut down MySQL server
mysql_sqlstate() SQLSTATE value for most recently invoked MySQL function
mysql_ssl_set() Prepare to establish SSL connection to server 8.0.35
mysql_stat() Server status
mysql_store_result() Retrieve and store entire result set
mysql_thread_id() Current thread ID
mysql_use_result() Initiate row-by-row result set retrieval
mysql_warning_count() Warning count for previous statement