MySQL 5.6 C API Developer Guide

Abstract

This is the MySQL 5.6 C API Developer Guide. This document accompanies MySQL 5.6 Reference Manual.

The C API provides low-level access to the MySQL client/server protocol and enables C programs to access database contents. The C API code is distributed with MySQL and implemented in the libmysqlclient library.

For legal information, see the Legal Notices.

For help with using MySQL, please visit the MySQL Forums, where you can discuss your issues with other MySQL users.

Document generated on: 2020-08-06 (revision: 66913)

Table of Contents

Preface and Legal Notices
1 The MySQL C API
2 MySQL C API Implementations
3 Example C API Client Programs
4 Building and Running C API Client Programs
4.1 Building C API Client Programs
4.2 Writing C API Threaded Client Programs
4.3 Running C API Client Programs
4.4 C API Server Version and Client Library Version
5 C API Data Structures
6 C API Function Overview
7 C API Function Descriptions
7.1 mysql_affected_rows()
7.2 mysql_autocommit()
7.3 mysql_change_user()
7.4 mysql_character_set_name()
7.5 mysql_close()
7.6 mysql_commit()
7.7 mysql_connect()
7.8 mysql_create_db()
7.9 mysql_data_seek()
7.10 mysql_debug()
7.11 mysql_drop_db()
7.12 mysql_dump_debug_info()
7.13 mysql_eof()
7.14 mysql_errno()
7.15 mysql_error()
7.16 mysql_escape_string()
7.17 mysql_fetch_field()
7.18 mysql_fetch_field_direct()
7.19 mysql_fetch_fields()
7.20 mysql_fetch_lengths()
7.21 mysql_fetch_row()
7.22 mysql_field_count()
7.23 mysql_field_seek()
7.24 mysql_field_tell()
7.25 mysql_free_result()
7.26 mysql_get_character_set_info()
7.27 mysql_get_client_info()
7.28 mysql_get_client_version()
7.29 mysql_get_host_info()
7.30 mysql_get_proto_info()
7.31 mysql_get_server_info()
7.32 mysql_get_server_version()
7.33 mysql_get_ssl_cipher()
7.34 mysql_hex_string()
7.35 mysql_info()
7.36 mysql_init()
7.37 mysql_insert_id()
7.38 mysql_kill()
7.39 mysql_library_end()
7.40 mysql_library_init()
7.41 mysql_list_dbs()
7.42 mysql_list_fields()
7.43 mysql_list_processes()
7.44 mysql_list_tables()
7.45 mysql_more_results()
7.46 mysql_next_result()
7.47 mysql_num_fields()
7.48 mysql_num_rows()
7.49 mysql_options()
7.50 mysql_options4()
7.51 mysql_ping()
7.52 mysql_query()
7.53 mysql_real_connect()
7.54 mysql_real_escape_string()
7.55 mysql_real_query()
7.56 mysql_refresh()
7.57 mysql_reload()
7.58 mysql_rollback()
7.59 mysql_row_seek()
7.60 mysql_row_tell()
7.61 mysql_select_db()
7.62 mysql_set_character_set()
7.63 mysql_set_local_infile_default()
7.64 mysql_set_local_infile_handler()
7.65 mysql_set_server_option()
7.66 mysql_shutdown()
7.67 mysql_sqlstate()
7.68 mysql_ssl_set()
7.69 mysql_stat()
7.70 mysql_store_result()
7.71 mysql_thread_id()
7.72 mysql_use_result()
7.73 mysql_warning_count()
8 C API Prepared Statements
9 C API Prepared Statement Data Structures
9.1 C API Prepared Statement Type Codes
9.2 C API Prepared Statement Type Conversions
10 C API Prepared Statement Function Overview
11 C API Prepared Statement Function Descriptions
11.1 mysql_stmt_affected_rows()
11.2 mysql_stmt_attr_get()
11.3 mysql_stmt_attr_set()
11.4 mysql_stmt_bind_param()
11.5 mysql_stmt_bind_result()
11.6 mysql_stmt_close()
11.7 mysql_stmt_data_seek()
11.8 mysql_stmt_errno()
11.9 mysql_stmt_error()
11.10 mysql_stmt_execute()
11.11 mysql_stmt_fetch()
11.12 mysql_stmt_fetch_column()
11.13 mysql_stmt_field_count()
11.14 mysql_stmt_free_result()
11.15 mysql_stmt_init()
11.16 mysql_stmt_insert_id()
11.17 mysql_stmt_next_result()
11.18 mysql_stmt_num_rows()
11.19 mysql_stmt_param_count()
11.20 mysql_stmt_param_metadata()
11.21 mysql_stmt_prepare()
11.22 mysql_stmt_reset()
11.23 mysql_stmt_result_metadata()
11.24 mysql_stmt_row_seek()
11.25 mysql_stmt_row_tell()
11.26 mysql_stmt_send_long_data()
11.27 mysql_stmt_sqlstate()
11.28 mysql_stmt_store_result()
12 C API Threaded Function Descriptions
12.1 my_init()
12.2 mysql_thread_end()
12.3 mysql_thread_init()
12.4 mysql_thread_safe()
13 C API Embedded Server Function Descriptions
13.1 mysql_server_end()
13.2 mysql_server_init()
14 C API Client Plugin Functions
14.1 mysql_client_find_plugin()
14.2 mysql_client_register_plugin()
14.3 mysql_load_plugin()
14.4 mysql_load_plugin_v()
14.5 mysql_plugin_options()
15 C API Support for Encrypted Connections
16 C API Multiple Statement Execution Support
17 C API Prepared Statement Handling of Date and Time Values
18 C API Prepared CALL Statement Support
19 C API Prepared Statement Problems
20 C API Automatic Reconnection Control
21 C API Common Issues
21.1 Why mysql_store_result() Sometimes Returns NULL After mysql_query() Returns Success
21.2 What Results You Can Get from a Query
21.3 How to Get the Unique ID for the Last Inserted Row
Index