Mysql C Api - Oracle 5.0 Reference Manual

Table of Contents

Advertisement

Function
mysql_thread_init()
mysql_thread_end()
Then, link your code with
compatibility between your application and the server library, be sure to compile your application
against headers for the same series of MySQL that was used to compile the server library. For
example, if
against MySQL 5.1 headers, or vice versa.
The
mysql_library_xxx()
change between the embedded and the client/server version by just linking your application with the
right library. See
One difference between the embedded server and the standalone server is that for the embedded
server, authentication for connections is disabled by default. To use authentication for the embedded
server, specify the
configure your MySQL distribution.

20.6. MySQL C API

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
Most other client APIs use the
(Exceptions are except Connector/J and Connector/Net.) This means that, for example, you can take
advantage of many of the same environment variables that are used by other client programs because
they are referenced from the library. For a list of these variables, see
Programs".
For instructions on building client programs using the C API, see
Client
Programs". For programming with threads, see
Programs". To create a standalone application which includes the "server" and "client" in the same
program (and does not communicate with an external MySQL server), see
Embedded MySQL Server
Clients have a maximum communication buffer size. The size of the buffer that is allocated initially
(16KB) is automatically increased up to the maximum size (16MB by default). Because buffer sizes
are increased only as demand warrants, simply increasing the maximum limit does not in itself cause
more resources to be used. This size check is mostly a precaution against erroneous statements and
communication packets.
The communication buffer must be large enough to contain a single SQL statement (for client-to-server
traffic) and one row of returned data (for server-to-client traffic). Each session's communication buffer
is dynamically enlarged to handle any query or row up to the maximum limit. For example, if you have
When to Call
Call it in each thread you create that accesses MySQL.
Call it before calling pthread_exit().
libmysqld.a
was compiled against MySQL 4.1 headers, do not compile your application
libmysqld
functions are also included in
Section 20.6.6.40,
--with-embedded-privilege-control
library See
Section 20.6.1, "MySQL C API
libmysqlclient
Library".
Note
If, after an upgrade, you experience problems with compiled client programs,
such as
Commands out of sync
were probably compiled using old header or library files. In this case, check
the date of the
compilation to verify that they are from the new MySQL distribution. If not,
recompile he programs with the new headers and libraries. Recompilation
might also be necessary for programs compiled against the shared client
library if the library major version number has changed (for example, from
libmysqlclient.so.15
MySQL C API
instead of libmysqlclient.a. To ensure binary
"mysql_library_init()".
library to communicate with the MySQL server.
Section 20.6.3.2, "Writing C API Threaded Client
or unexpected core dumps, the programs
file and
mysql.h
libmysqlclient.a
to libmysqlclient.so.16).
2130
to enable you to
libmysqlclient.a
option when you invoke
Implementations".
Section 4.1, "Overview of MySQL
Section 20.6.3.1, "Building C API
Section 20.5, "libmysqld, the
library used for
to
configure

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 5.0 and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Mysql 5.0

Table of Contents