Chapter 8. MySQL APIs

With a number of APIs, you can use a MySQL database in applications written in various programming languages. Even if no specific language API exists, you can still use Open Database Connectivity (ODBC) to communicate with a MySQL server.

In this Chapter you will find brief examples of how to connect to a database, perform a query, and retrieve the results using the most popular APIs.

The C Language API

The C API is the underlying interface used by all the other APIs, and almost every function call in another language’s API maps directly to a corresponding C library function.

To use the C API you must link your program with the libmysqlclient.so library that is installed automatically if you compile MySQL from source. For those ...

Get MySQL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.