21.8.1 MySQL C API Implementations

The MySQL C API is a C-based API that client applications written in C can use to communicate with MySQL Server. Client programs refer to C API header files at compile time and link to a C API library file at link time. The library comes in two versions, depending on how the application is intended to communicate with the server:

Both libraries have the same interface. In terms of C API calls, an application communicates with a standalone server the same way it communicates with an embedded server. A given client can be built to communicate with a standalone or embedded server, depending on whether it is linked against libmysqlclient or libmysqld at build time.

There are two ways to obtain the C API header and library files required to build C API client programs:

For both MySQL Server and MySQL Connector/C, you can install a binary distribution that contains the C API files pre-built, or you can use a source distribution and build the C API files yourself.

Normally, you install either a MySQL Server distribution or a MySQL Connector/C distribution, but not both. For information about issues involved with simultaneous MySQL Server and MySQL Connector/C installations, see Section 21.8.2, “Simultaneous MySQL Server and MySQL Connector/C Installations”.

The names of the library files to use when linking C API client applications depend on the library type and platform for which a distribution is built: