> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/connectors/mariadb-connector-c.md).

# Connector/C

- [MariaDB Connector/C Overview](https://mariadb.com/docs/connectors/mariadb-connector-c/mariadb-connector-c-guide.md): Complete Connector/C reference: Windows MSI install, Linux packages (yum/apt/zypper), MariaDB-shared/devel libraries, and option file configuration.
- [Install MariaDB Connector/C](https://mariadb.com/docs/connectors/mariadb-connector-c/install-mariadb-connector-c.md): Complete MariaDB installation guide. Complete setup instructions for Linux, Windows, and macOS with configuration and verification for production use.
- [Configuring MariaDB Connector/C with Option Files](https://mariadb.com/docs/connectors/mariadb-connector-c/configuring-mariadb-connectorc-with-option-files.md): MariaDB Connector/C reads connection settings from option files such as my.cnf, supporting default and custom file locations, option groups, and a full set of client options.
- [MariaDB Binlog/Replication API reference](https://mariadb.com/docs/connectors/mariadb-connector-c/mariadb-binlogreplication-api-reference.md): MariaDB Connector/C binlog and replication API reference, documenting the functions used to consume binary log events from a MariaDB server as a replication client.
- [Binlog/API Data Structures](https://mariadb.com/docs/connectors/mariadb-connector-c/mariadb-binlogreplication-api-reference/binlog-api-data-structures.md): All structures and type definitions for the Binglog/Replication API are defined in include/mariadb\_rpl.h.
- [Replication API Types and Definitions](https://mariadb.com/docs/connectors/mariadb-connector-c/mariadb-binlogreplication-api-reference/replication-api-types-and-definitions.md): All enumerations and preprocessor definitions for the Binglog/Replication API are defined in include/mariadb\_rpl.h.
- [Replication API Function Reference](https://mariadb.com/docs/connectors/mariadb-connector-c/mariadb-binlogreplication-api-reference/replication-api-function-reference.md): All functions in the Binlog/Replication API are defined in include/mariadb\_rpl.h
- [mariadb\_rpl\_init()](https://mariadb.com/docs/connectors/mariadb-connector-c/mariadb-binlogreplication-api-reference/replication-api-function-reference/mariadb_rpl_init.md)
- [mariadb\_rpl\_optionsv()](https://mariadb.com/docs/connectors/mariadb-connector-c/mariadb-binlogreplication-api-reference/replication-api-function-reference/mariadb_rpl_optionsv.md)
- [mariadb\_rpl\_get\_optionsv()](https://mariadb.com/docs/connectors/mariadb-connector-c/mariadb-binlogreplication-api-reference/replication-api-function-reference/mariadb_rpl_get_optionsv.md)
- [mariadb\_rpl\_open()](https://mariadb.com/docs/connectors/mariadb-connector-c/mariadb-binlogreplication-api-reference/replication-api-function-reference/mariadb_rpl_open.md)
- [mariadb\_rpl\_fetch()](https://mariadb.com/docs/connectors/mariadb-connector-c/mariadb-binlogreplication-api-reference/replication-api-function-reference/mariadb_rpl_fetch.md)
- [mariadb\_free\_rpl\_event()](https://mariadb.com/docs/connectors/mariadb-connector-c/mariadb-binlogreplication-api-reference/replication-api-function-reference/mariadb_free_rpl_event.md)
- [mariadb\_rpl\_extract\_rows()](https://mariadb.com/docs/connectors/mariadb-connector-c/mariadb-binlogreplication-api-reference/replication-api-function-reference/mariadb_rpl_extract_rows.md)
- [mariadb\_rpl\_errno()](https://mariadb.com/docs/connectors/mariadb-connector-c/mariadb-binlogreplication-api-reference/replication-api-function-reference/mariadb_rpl_errno.md)
- [mariadb\_rpl\_error()](https://mariadb.com/docs/connectors/mariadb-connector-c/mariadb-binlogreplication-api-reference/replication-api-function-reference/mariadb_rpl_error.md)
- [mariadb\_rpl\_close()](https://mariadb.com/docs/connectors/mariadb-connector-c/mariadb-binlogreplication-api-reference/replication-api-function-reference/mariadb_rpl_close.md)
- [Example](https://mariadb.com/docs/connectors/mariadb-connector-c/mariadb-binlogreplication-api-reference/replication-api-function-reference/example.md)
- [MariaDB Connector/C Data Structures](https://mariadb.com/docs/connectors/mariadb-connector-c/mariadb-connectorc-data-structures.md): Reference for the public data structures in MariaDB Connector/C, including MYSQL, MYSQL\_RES, MYSQL\_STMT, MYSQL\_FIELD, MYSQL\_BIND, and MYSQL\_TIME with all member definitions.
- [MariaDB Connector/C Plugins](https://mariadb.com/docs/connectors/mariadb-connector-c/mariadb-connectorc-plugins.md): MariaDB Connector/C supports loadable and built-in plugins across four categories: connection, pvio, I/O, and authentication, including remote\_io and multiple auth methods.
- [MariaDB Connector/C Types and Definitions](https://mariadb.com/docs/connectors/mariadb-connector-c/mariadb-connectorc-types-and-definitions.md): Reference for MariaDB Connector/C types and definitions, including enumeration constants for field types, statement options, cursor types, indicator types, field flags, and server status.
- [Building Connector/C From Source](https://mariadb.com/docs/connectors/mariadb-connector-c/building-connectorc-from-source.md): Build MariaDB Connector/C from source. Download the package from MariaDB downloads or get the latest development version from the Connector/C GitHub repository.
- [Compiling Connector/C](https://mariadb.com/docs/connectors/mariadb-connector-c/building-connectorc-from-source/compiling-connectorc.md): Compile MariaDB Connector/C after configuration using CMake on Windows or Unix. Supports Visual Studio builds and GNU make, with both IDE and command-line build options.
- [Configuration Settings for Building Connector/C](https://mariadb.com/docs/connectors/mariadb-connector-c/building-connectorc-from-source/configuration-settings-for-building-connectorc.md): Configure the MariaDB Connector/C build via CMake options including build type, TLS/SSL backend, install prefix, and client plugins such as authentication and connection handlers.
- [Prerequisites For Building Connector/C From Source](https://mariadb.com/docs/connectors/mariadb-connector-c/building-connectorc-from-source/prerequisites-for-building-connectorc-from-source.md): Building MariaDB Connector/C from source requires CMake, a C compiler, and TLS/SSL libraries. Windows needs Visual Studio; Linux and macOS need gcc with optional Curl or Kerberos.
- [MariaDB Connector/C API Functions](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions.md): Explore API functions for MariaDB Connector/C. This section provides detailed documentation on functions for connecting, querying, and managing data, enabling robust C applications for MariaDB.
- [mariadb\_cancel](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mariadb_cancel.md): mariadb\_cancel immediately aborts a connection by making all subsequent read/write operations fail, without freeing the MYSQL structure or closing communication channels.
- [mariadb\_connect](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mariadb_connect.md): Connect to a database server using a connection string
- [mariadb\_connection](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mariadb_connection.md)
- [mariadb\_convert\_string](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mariadb_convert_string.md)
- [mariadb\_field\_attr](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mariadb_field_attr.md)
- [mariadb\_get\_info](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mariadb_get_info.md)
- [mariadb\_get\_infov](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mariadb_get_infov.md): mariadb\_get\_infov retrieves generic or connection-specific information from a MariaDB Connector/C handle, accepting a value-type enum and a pointer to store the result.
- [mariadb\_reconnect](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mariadb_reconnect.md): mariadb\_reconnect attempts to re-establish a dropped MariaDB Connector/C connection using the original credentials, and requires the MYSQL\_OPT\_RECONNECT option to be set.
- [mysql\_affected\_rows](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_affected_rows.md): mysql\_affected\_rows returns the number of rows affected by the last INSERT, UPDATE, DELETE, or REPLACE statement executed on a MariaDB Connector/C connection.
- [mysql\_autocommit](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_autocommit.md): mysql\_autocommit enables or disables autocommit mode for the current database connection, returning zero on success or nonzero on failure.
- [mysql\_change\_user](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_change_user.md): mysql\_change\_user changes the authenticated user and default database on an existing connection, resetting session state including transactions, temporary tables, and locks.
- [mysql\_character\_set\_name](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_character_set_name.md): mysql\_character\_set\_name returns the name of the default client character set for a specified MariaDB Connector/C connection.
- [mysql\_client\_find\_plugin](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_client_find_plugin.md)
- [mysql\_close](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_close.md): mysql\_close terminates an open database connection and releases the memory allocated for the MYSQL handle.
- [mysql\_commit](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_commit.md): mysql\_commit commits the current transaction on a MariaDB Connector/C connection, returning zero on success without affecting autocommit mode.
- [mysql\_data\_seek](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_data_seek.md): mysql\_data\_seek moves the result set pointer to an arbitrary row offset in a buffered result set obtained via mysql\_store\_result, enabling random row access.
- [mysql\_debug](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_debug.md): mysql\_debug enables debug output for a MariaDB Connector/C client using the DBUG library, accepting a colon-separated control string to configure trace and logging options.
- [mysql\_dump\_debug\_info](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_dump_debug_info.md): mysql\_dump\_debug\_info instructs a MariaDB server to write connection status information to the error log, and requires the SUPER privilege for the current user.
- [mysql\_eof](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_eof.md)
- [mysql\_errno](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_errno.md): mysql\_errno returns the numeric error code from the most recent MariaDB Connector/C function call, or zero if no error occurred.
- [mysql\_error](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_error.md): mysql\_error returns the error message string for the most recent failed MariaDB Connector/C function call, or an empty string if no error occurred.
- [mysql\_escape\_string](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_escape_string.md): mysql\_escape\_string encodes a string using the default character set for safe use in SQL statements. Deprecated — use mysql\_real\_escape\_string instead.
- [mysql\_fetch\_field](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_fetch_field.md): mysql\_fetch\_field returns the definition of one result set column as a MYSQL\_FIELD pointer; call it repeatedly to iterate over all columns in the result set.
- [mysql\_fetch\_field\_direct](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_fetch_field_direct.md): mysql\_fetch\_field\_direct returns a MYSQL\_FIELD pointer for a specific column in a result set, identified by its zero-based field number.
- [mysql\_fetch\_fields](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_fetch_fields.md): mysql\_fetch\_fields returns all column definitions for a MariaDB result set as an array of MYSQL\_FIELD structures, one entry per column.
- [mysql\_fetch\_lengths](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_fetch_lengths.md): mysql\_fetch\_lengths returns an array of byte lengths for each column in the current row of a MariaDB result set, valid only after mysql\_fetch\_row is called.
- [mysql\_fetch\_row](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_fetch_row.md): mysql\_fetch\_row retrieves the next row from a MariaDB result set as an array of char pointers, returning NULL when no more rows are available.
- [mysql\_field\_count](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_field_count.md): mysql\_field\_count returns the number of columns in the most recent query result for a MariaDB connection, useful for checking whether a result set is available.
- [mysql\_field\_seek](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_field_seek.md): mysql\_field\_seek sets the field cursor to a given column offset in a MariaDB result set, controlling which field mysql\_fetch\_field returns next.
- [mysql\_field\_tell](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_field_tell.md): mysql\_field\_tell retrieves the current field cursor position in a result set, which can be passed to mysql\_field\_seek to restore that position.
- [mysql\_free\_result](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_free_result.md): mysql\_free\_result releases the memory allocated for a MariaDB result set; row values obtained from prior mysql\_fetch\_row calls become invalid after this call.
- [mysql\_get\_character\_set\_info](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_get_character_set_info.md): mysql\_get\_character\_set\_info populates a MY\_CHARSET\_INFO structure with details about the current default character set for a MariaDB Connector/C connection.
- [mysql\_get\_client\_info](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_get_client_info.md): mysql\_get\_client\_info retrieves the client library version as a string; use mysql\_get\_client\_version for the equivalent numeric value.
- [mysql\_get\_client\_version](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_get_client_version.md): mysql\_get\_client\_version retrieves the client library version as an unsigned long; use mysql\_get\_client\_info for the string representation.
- [mysql\_get\_host\_info](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_get_host_info.md): mysql\_get\_host\_info returns a string describing the connection type and server hostname for a MariaDB Connector/C connection, or NULL if invalid.
- [mysql\_get\_optionv](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_get_optionv.md): mysql\_get\_optionv retrieves the current value of a connection option previously set with mysql\_optionsv, supporting boolean, integer, string, and miscellaneous option types.
- [mysql\_get\_proto\_info](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_get_proto_info.md): mysql\_get\_proto\_info returns the protocol version number used for a MariaDB Connector/C connection; versions 9 and below are not supported.
- [mysql\_get\_server\_info](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_get_server_info.md): mysql\_get\_server\_info retrieves the connected server version string; use mysql\_get\_server\_version for the equivalent numeric representation.
- [mysql\_get\_server\_version](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_get_server_version.md): mysql\_get\_server\_version retrieves the server version as an unsigned long; use mysql\_get\_server\_info for the equivalent string representation.
- [mysql\_get\_ssl\_cipher](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_get_ssl_cipher.md): mysql\_get\_ssl\_cipher returns the name of the TLS cipher in use for a MariaDB Connector/C connection, or NULL for non-TLS connections.
- [mysql\_get\_timeout\_value](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_get_timeout_value.md)
- [mysql\_get\_timeout\_value\_ms](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_get_timeout_value_ms.md)
- [mysql\_hex\_string](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_hex_string.md): mysql\_hex\_string converts a binary buffer to a hex-encoded string for safe embedding in SQL; the output buffer must be at least 2\*length+1 bytes.
- [mysql\_info](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_info.md): mysql\_info returns a string with summary statistics about the last executed query, covering INSERT, UPDATE, ALTER TABLE, and LOAD DATA operations; returns NULL for SELECT.
- [mysql\_init](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_init.md): mysql\_init allocates and initializes a MYSQL structure for use with mysql\_real\_connect, and also initializes the thread subsystem if not already done.
- [mysql\_insert\_id](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_insert_id.md): mysql\_insert\_id returns the AUTO\_INCREMENT value generated by the last INSERT or UPDATE statement on a MariaDB connection, or zero if no such value was produced.
- [mysql\_kill](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_kill.md): mysql\_kill requests the MariaDB server to terminate the thread with the given process ID; use mysql\_thread\_id to obtain the ID of the current connection.
- [mysql\_load\_plugin](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_load_plugin.md)
- [mysql\_library\_end](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_library_end.md): mysql\_library\_end finalizes the MariaDB Connector/C library after use, performing memory cleanup and shutting down the embedded server if applicable.
- [mysql\_library\_init](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_library_init.md): mysql\_library\_init initializes the MariaDB Connector/C library before any other functions are called, starting the embedded server if used in that configuration.
- [mysql\_more\_results](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_more_results.md): mysql\_more\_results indicates whether additional result sets remain from a previous multi-statement query, returning 1 if more results are available.
- [mysql\_net\_field\_length](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_net_field_length.md)
- [mysql\_net\_read\_packet](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_net_read_packet.md)
- [mysql\_next\_result](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_next_result.md): mysql\_next\_result advances to the next result set from a multi-statement query, making it available for retrieval via mysql\_store\_result or mysql\_use\_result.
- [mysql\_num\_fields](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_num_fields.md): mysql\_num\_fields retrieves the column count from a result set handle, useful for iterating over fields in a MariaDB query result.
- [mysql\_num\_rows](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_num_rows.md): mysql\_num\_rows returns the number of rows in a MariaDB result set; for unbuffered results the count is only accurate after all rows have been fetched.
- [mysql\_options4](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_options4.md)
- [mysql\_options](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_options.md): mysql\_options sets extra connection options on a MYSQL handle before calling mysql\_real\_connect. Deprecated since Connector/C 3.0 — use mysql\_optionsv instead.
- [mysql\_optionsv](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_optionsv.md): mysql\_optionsv sets connection, TLS, plugin, and option-file options on a MariaDB Connector/C handle before mysql\_real\_connect, supporting a variable argument list.
- [mysql\_ping](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_ping.md): mysql\_ping checks whether a MariaDB server connection is still active and attempts an automatic reconnect if the connection has dropped and reconnect is enabled.
- [mysql\_query](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_query.md): mysql\_query sends a null-terminated SQL string to the MariaDB server for execution, returning zero on success; use mysql\_real\_query for binary-safe operation.
- [mysql\_read\_query\_result](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_read_query_result.md): mysql\_read\_query\_result reads the result of a statement previously sent with mysql\_send\_query, and must be called once for each successful mysql\_send\_query call.
- [mysql\_real\_connect](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_real_connect.md): mysql\_real\_connect opens a connection to a MariaDB server and returns a MYSQL handle on success, or NULL if the connection could not be established.
- [mysql\_real\_escape\_string](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_real_escape_string.md): mysql\_real\_escape\_string encodes a string for safe use in a SQL statement, taking the connection's current character set into account when escaping special characters.
- [mysql\_real\_query](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_real_query.md): mysql\_real\_query sends a binary-safe SQL statement to a MariaDB server; use mysql\_num\_fields to determine whether the query returned a result set.
- [mysql\_refresh](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_refresh.md): mysql\_refresh flushes server-side caches and state using a bitmask of options such as REFRESH\_GRANT, REFRESH\_LOG, REFRESH\_TABLES, and REFRESH\_HOSTS.
- [mysql\_reset\_connection](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_reset_connection.md): mysql\_reset\_connection resets session state on a MariaDB Connector/C connection — rolling back transactions and clearing variables — without disconnecting or reauthenticating.
- [mysql\_rollback](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_rollback.md): mysql\_rollback undoes the current transaction for a database connection; it has no effect if autocommit is enabled or the engine is non-transactional.
- [mysql\_row\_seek](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_row_seek.md): mysql\_row\_seek repositions the row cursor in a buffered MariaDB result set to an arbitrary offset, returning the previous row position as a MYSQL\_ROW\_OFFSET.
- [mysql\_row\_tell](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_row_tell.md): mysql\_row\_tell returns the current row cursor offset for a buffered MariaDB result set, which can then be passed to mysql\_row\_seek to restore that position.
- [mysql\_select\_db](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_select_db.md): mysql\_select\_db changes the default database on an active connection; the current default can also be queried with the SELECT DATABASE() SQL function.
- [mysql\_send\_query](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_send_query.md): mysql\_send\_query dispatches a query asynchronously on a MariaDB connection; each call must be followed by mysql\_read\_query\_result to consume the response.
- [mysql\_server\_end](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_server_end.md): mysql\_server\_end is an alias for mysql\_library\_end in MariaDB Connector/C, used to finalize and clean up the client library.
- [mysql\_server\_init](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_server_init.md): mysql\_server\_init is an alias for mysql\_library\_init in MariaDB Connector/C, used to initialize the client library before making any other calls.
- [mysql\_session\_track\_get\_first](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_session_track_get_first.md): mysql\_session\_track\_get\_first retrieves the first session state change notification from the server, covering schema changes, system variables, and state flags. Added in Connector/C 3.0.
- [mysql\_session\_track\_get\_next](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_session_track_get_next.md): mysql\_session\_track\_get\_next retrieves subsequent session state change notifications after mysql\_session\_track\_get\_first, called repeatedly until a nonzero value signals end of data.
- [mysql\_set\_character\_set](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_set_character_set.md): mysql\_set\_character\_set sets the default character set for a MariaDB Connector/C connection, ensuring mysql\_real\_escape\_string uses the correct encoding.
- [mysql\_set\_server\_option](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_set_server_option.md): mysql\_set\_server\_option enables or disables multi-statement support on a MariaDB connection using MYSQL\_OPTION\_MULTI\_STATEMENTS\_ON or \_OFF.
- [mysql\_set\_local\_infile\_handler](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_set_local_infile_handler.md): mysql\_set\_local\_infile\_handler registers custom callback functions for init, read, end, and error phases of a LOAD DATA LOCAL INFILE operation in MariaDB Connector/C.
- [mysql\_set\_local\_infile\_default](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_set_local_infile_default.md): mysql\_set\_local\_infile\_default resets local infile callbacks to the Connector/C internal defaults, reversing any custom handler registered via mysql\_set\_local\_infile\_handler.
- [mysql\_shutdown](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_shutdown.md): mysql\_shutdown sends a shutdown request to the MariaDB server over the current connection, requiring the SHUTDOWN privilege for the authenticated user.
- [mysql\_sqlstate](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_sqlstate.md): mysql\_sqlstate returns the five-character SQLSTATE error code for the most recent MariaDB Connector/C function call, with 00000 indicating success.
- [mysql\_ssl\_set](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_ssl_set.md): mysql\_ssl\_set configures TLS parameters including key, certificate, CA, and cipher list for a MariaDB connection, and must be called before mysql\_real\_connect.
- [mysql\_stat](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_stat.md): mysql\_stat returns a status string from the MariaDB server covering uptime, active threads, query count, open tables, and queries per second.
- [mysql\_store\_result](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_store_result.md): mysql\_store\_result retrieves a complete buffered result set from the last executed MariaDB query, returning NULL on error or for non-SELECT statements.
- [mysql\_thread\_end](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_thread_end.md): mysql\_thread\_end releases thread-local memory allocated by mysql\_thread\_init and must be called explicitly before a thread exits to avoid memory leaks. Deprecated in Connector/C 3.0.
- [mysql\_thread\_id](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_thread_id.md): mysql\_thread\_id retrieves the thread identifier for an active connection; the value may change after a reconnect if the reconnect option is enabled.
- [mysql\_thread\_init](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_thread_init.md): mysql\_thread\_init initializes thread-local variables for multi-threaded Connector/C clients; called automatically by mysql\_init if not invoked explicitly. Deprecated in Connector/C 3.0.
- [mysql\_thread\_safe](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_thread_safe.md): mysql\_thread\_safe returns 1 if the MariaDB Connector/C client library was compiled with thread-safety support, or zero otherwise.
- [mysql\_use\_result](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_use_result.md): mysql\_use\_result initiates unbuffered retrieval of a query result set row by row from the MariaDB server, blocking the connection until all rows are fetched or freed.
- [mysql\_warning\_count](https://mariadb.com/docs/connectors/mariadb-connector-c/api-functions/mysql_warning_count.md): mysql\_warning\_count retrieves the warning count from the most recent query execution; use SHOW WARNINGS for the full warning message text.
- [MariaDB Connector/C API Prepared Statement Functions](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions.md): Explore API functions for prepared statements in Connector/C. This section provides detailed documentation on using prepared statements for efficient and secure query execution in C applications.
- [mariadb\_stmt\_execute\_direct](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mariadb_stmt_execute_direct.md): mariadb\_stmt\_execute\_direct prepares and executes a statement in a single call using a pre-allocated MYSQL\_STMT handle, available in Connector/C 3.0 with MariaDB 10.2 or later.
- [mariadb\_stmt\_fetch\_fields](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mariadb_stmt_fetch_fields.md): mariadb\_stmt\_fetch\_fields returns an array of MYSQL\_FIELD descriptors for each result set column of a prepared statement, added in MariaDB Connector/C 3.1.0.
- [mysql\_stmt\_affected\_rows](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_affected_rows.md): mysql\_stmt\_affected\_rows returns the number of rows affected by the last INSERT, UPDATE, DELETE, or REPLACE prepared statement, or -1 if the statement failed.
- [mysql\_stmt\_attr\_get](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_attr_get.md): mysql\_stmt\_attr\_get retrieves the current value of a prepared statement attribute, such as cursor type, prefetch row count, or max-length update behavior.
- [mysql\_stmt\_attr\_set](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_attr_set.md): mysql\_stmt\_attr\_set configures a prepared statement attribute on a Connector/C statement handle; supported attributes include cursor type, prefetch rows, and bulk-insert array size.
- [mysql\_stmt\_bind\_param](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_bind_param.md): mysql\_stmt\_bind\_param binds an array of MYSQL\_BIND variables to the parameter markers in a prepared statement before it is executed via mysql\_stmt\_execute.
- [mysql\_stmt\_bind\_result](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_bind_result.md): mysql\_stmt\_bind\_result maps result-set columns to application variables via an array of MYSQL\_BIND structures, enabling mysql\_stmt\_fetch to populate those variables.
- [mysql\_stmt\_close](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_close.md): mysql\_stmt\_close deallocates a prepared statement handle and cancels any pending results, freeing server and client resources associated with the statement.
- [mysql\_stmt\_data\_seek](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_data_seek.md): mysql\_stmt\_data\_seek positions the row cursor to an arbitrary offset in a buffered prepared statement result set previously stored with mysql\_stmt\_store\_result.
- [mysql\_stmt\_errno](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_errno.md): mysql\_stmt\_errno returns the numeric error code for the most recently invoked Connector/C prepared statement function, or zero if no error occurred.
- [mysql\_stmt\_error](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_error.md): mysql\_stmt\_error retrieves the human-readable error message from the last Connector/C prepared statement call, complementing the numeric code from mysql\_stmt\_errno.
- [mysql\_stmt\_execute](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_execute.md): mysql\_stmt\_execute runs a prepared statement previously set up with mysql\_stmt\_prepare, substituting bound parameter values and returning zero on success.
- [mysql\_stmt\_fetch](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_fetch.md): mysql\_stmt\_fetch retrieves the next row from a prepared statement result set into the buffers bound by mysql\_stmt\_bind\_result, returning MYSQL\_NO\_DATA at end of set.
- [mysql\_stmt\_fetch\_column](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_fetch_column.md): mysql\_stmt\_fetch\_column fetches part of a single column value from the current prepared statement row, allowing large data to be read incrementally via an offset.
- [mysql\_stmt\_field\_count](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_field_count.md): mysql\_stmt\_field\_count reports how many fields a prepared statement result set contains; it returns zero for INSERT, UPDATE, DELETE, and REPLACE statements.
- [mysql\_stmt\_free\_result](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_free_result.md): mysql\_stmt\_free\_result frees client-side result memory for a Connector/C prepared statement, complementing mysql\_stmt\_store\_result to manage buffer lifecycle.
- [mysql\_stmt\_init](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_init.md): mysql\_stmt\_init allocates and initializes a MYSQL\_STMT prepared statement handle for a Connector/C connection, returning NULL if memory allocation fails.
- [mysql\_stmt\_insert\_id](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_insert_id.md): mysql\_stmt\_insert\_id returns the AUTO\_INCREMENT value generated by the most recent prepared INSERT or UPDATE statement, or zero if no auto-increment column was affected.
- [mysql\_stmt\_more\_results](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_more_results.md): mysql\_stmt\_more\_results indicates if one or more results from a previously executed prepared statement are available
- [mysql\_stmt\_next\_result](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_next_result.md): mysql\_stmt\_next\_result advances to the next result set when a prepared statement returns multiple results, enabling traversal of multi-statement query output.
- [mysql\_stmt\_num\_rows](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_num_rows.md): mysql\_stmt\_num\_rows returns the total row count of a buffered prepared statement result set; it requires mysql\_stmt\_store\_result to have been called first.
- [mysql\_stmt\_param\_count](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_param_count.md): mysql\_stmt\_param\_count reports how many placeholder parameters a prepared statement contains, indicating the size of the MYSQL\_BIND array required for binding.
- [mysql\_stmt\_param\_metadata](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_param_metadata.md): mysql\_stmt\_param\_metadata retrieves parameter metadata for a prepared statement handle, returning a MYSQL\_RES pointer that describes the bound parameters.
- [mysql\_stmt\_prepare](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_prepare.md): mysql\_stmt\_prepare parses and prepares a SQL statement on a Connector/C MYSQL\_STMT handle; parameter markers must be bound with mysql\_stmt\_bind\_param before execution.
- [mysql\_stmt\_reset](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_reset.md): mysql\_stmt\_reset resets a prepared statement on both client and server to its post-prepare state, clearing unbuffered results and errors while preserving bindings.
- [mysql\_stmt\_result\_metadata](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_result_metadata.md): mysql\_stmt\_result\_metadata retrieves result-set metadata from a Connector/C prepared statement; the returned MYSQL\_RES contains field information but no row data.
- [mysql\_stmt\_row\_seek](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_row_seek.md): mysql\_stmt\_row\_seek positions the row cursor to an arbitrary row in a buffered prepared statement result set, returning the previous cursor offset for later restoration.
- [mysql\_stmt\_row\_tell](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_row_tell.md): mysql\_stmt\_row\_tell returns the current row cursor offset of a buffered prepared statement result set, which can be passed to mysql\_stmt\_row\_seek to restore the position.
- [mysql\_stmt\_send\_long\_data](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_send_long_data.md): mysql\_stmt\_send\_long\_data sends a parameter value in chunks to the server, enabling large TEXT or BLOB data that exceeds max\_allowed\_packet to be streamed in multiple calls.
- [mysql\_stmt\_sqlstate](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_sqlstate.md): mysql\_stmt\_sqlstate returns the five-character SQLSTATE error code for the most recently invoked prepared statement function, with '00000' indicating no error occurred.
- [mysql\_stmt\_store\_result](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_store_result.md): mysql\_stmt\_store\_result buffers the complete result set of a prepared SELECT, SHOW, DESCRIBE, or EXPLAIN statement on the client, enabling random access and row count queries.
- [mysql\_stmt\_warning\_count](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/mysql_stmt_warning_count.md): mysql\_stmt\_warning\_count reports how many warnings the most recent Connector/C prepared statement raised; added in Connector/C 3.0. Use SHOW WARNINGS to retrieve messages.
- [Connector C Data Structures and Definitions](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/connector-c-data-structures-and-definitions.md): Explore practical examples of prepared statements. Learn how to use them to enhance application security against SQL injection and improve query performance by optimizing statement execution.
- [Connector/C Types and Definitions](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/connector-c-data-structures-and-definitions/connectorc-types-and-definitions.md): Connector/C field types and indicator variables used in the MYSQL\_BIND structure, including all MYSQL\_TYPE constants and STMT\_INDICATOR values defined in mariadb\_com.h.
- [MYSQL\_BIND](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/connector-c-data-structures-and-definitions/mysql_bind.md): MYSQL\_BIND is the MariaDB Connector/C structure used to bind input parameters and output result columns to a prepared statement, with support for array binding and indicator variables.
- [MYSQL\_STMT](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/connector-c-data-structures-and-definitions/mysql_stmt.md): MYSQL\_STMT is the MariaDB Connector/C handle for a prepared statement, allocated by mysql\_stmt\_init and released by mysql\_stmt\_close; all its members are private.
- [Prepared Statement Examples](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/prepared-statement-examples.md): Prepared statement examples
- [Bulk Insert (Column-wise Binding)](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/prepared-statement-examples/bulk-insert-column-wise-binding.md): Insert multiple rows in a single prepared statement call using column-wise binding. This example demonstrates indicator variables and STMT\_ATTR\_ARRAY\_SIZE with MariaDB Connector/C.
- [Bulk Insert (Row-wise Binding)](https://mariadb.com/docs/connectors/mariadb-connector-c/api-prepared-statement-functions/prepared-statement-examples/bulk-insert-row-wise-binding.md): Insert multiple rows in a single prepared statement call using row-wise binding. This example packs parameters into a C struct and sets STMT\_ATTR\_ROW\_SIZE for MariaDB Connector/C.
- [Connect with MariaDB Connector/C](https://mariadb.com/docs/connectors/mariadb-connector-c/connect-with-mariadb-connector-c.md): Connect a C or C++ application to MariaDB using Connector/C. Includes a complete code example demonstrating connection initialization, mysql\_real\_connect usage, and cleanup.
- [Development](https://mariadb.com/docs/connectors/mariadb-connector-c/development.md): Application Development with MariaDB Connector/C
- [Setup for Examples](https://mariadb.com/docs/connectors/mariadb-connector-c/setup-for-examples.md): Set up the test database and user account required by MariaDB Connector/C code examples, including schema creation SQL and privilege grants for db\_user.
- [DDL with MariaDB Connector/C](https://mariadb.com/docs/connectors/mariadb-connector-c/ddl-with-mariadb-connector-c.md): MariaDB Connector/C supports DDL operations such as CREATE TABLE, ALTER TABLE, and TRUNCATE TABLE, letting C applications modify database schema by executing SQL statements with mysql\_query().
- [DML with MariaDB Connector/C](https://mariadb.com/docs/connectors/mariadb-connector-c/dml-with-mariadb-connector-c.md): MariaDB Connector/C supports DML operations including INSERT, UPDATE, DELETE, and SELECT, using prepared statements and result sets to manipulate data in MariaDB databases.
- [Transactions with MariaDB Connector/C](https://mariadb.com/docs/connectors/mariadb-connector-c/transactions-with-mariadb-connector-c.md): MariaDB Connector/C supports multi-statement transactions with manual commit and rollback by disabling auto-commit with mysql\_autocommit() on the connection.
- [Batch Operations with MariaDB Connector/C](https://mariadb.com/docs/connectors/mariadb-connector-c/batch-operations-with-mariadb-connector-c.md): MariaDB Connector/C supports batch (bulk) operations by binding an array of parameter sets to a single prepared statement, sending many rows to the server in one execution.
- [Other C & C++ Connectors](https://mariadb.com/docs/connectors/mariadb-connector-c/other-c-c-connectors.md): Explore C and C++ connectors for MariaDB beyond the official offerings. This section covers alternative client libraries and methods for robust, high-performance database interactions.
- [C++ Client Library](https://mariadb.com/docs/connectors/mariadb-connector-c/other-c-c-connectors/c-client-library.md): mariadb++ is a C++ client library for connecting applications to MariaDB and MySQL databases, built on the mariadb-native-client library and maintained on GitHub.
- [MySQL Client Library 3.23.58](https://mariadb.com/docs/connectors/mariadb-connector-c/other-c-c-connectors/mysql-client-library-32358.md): MySQL client library 3.23.58 is an archived LGPL release for non-GPL distribution use cases, with known limitations including no prepared statements and deprecated password authentication.
