MySQL C API Implementations
2131
BLOB
values that contain up to 16MB of data, you must have a communication buffer limit of at least
16MB (in both server and client). The client's default maximum is 16MB, but the default maximum in
the server is 1MB. You can increase this by changing the value of the
max_allowed_packet
[466]
parameter at server startup. See
Section 8.9.2, “Tuning Server Parameters”
.
The MySQL server shrinks each communication buffer to
net_buffer_length
[477]
bytes after
each query. For clients, the size of the buffer associated with a connection is not decreased until the
connection is closed, at which time client memory is reclaimed.
20.6.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:
•
libmysqlclient
: The client version of the library, used for applications that communicate over a
network connection as a client of a standalone server process.
•
libmysqld
: The embedded server version of the library, used for applications intended to include
an embedded MySQL server within the application itself. The application communicates with its own
private server instance.
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:
• Install a MySQL Server distribution. Server distributions include both
libmysqlclient
and
libmysqld
.
• Install a MySQL Connector/C distribution. Connector/C distributions include only
libmysqlclient
.
They do not include
libmysqld
.
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. It is possible that installing both can cause problems.
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:
• On Unix (and Unix-like) sytems, the static library is
libmysqlclient.a
. The dynamic library is
libmysqlclient.so
on most Unix systems and
libmysqlclient.dylib
on Mac OS X.
For distributions that include embedded server libraries, the corresponding library names begin with
libmysqld
rather than
libmysqlclient
.
• On Windows, the static library is
mysqlclient.lib
and the dynamic library is
libmysql.dll
.
Windows distributions also include
libmysql.lib
, a static import library needed for using the
dynamic library.
For distributions that include embedded server libraries, the corresponding library names are
mysqlserver.lib
,
libmysqld.dll
, and
libmysqld.lib
.
Windows distributions also include a set of debug libraries. These have the same names as the
nondebug libraries, but are located in the
lib/debug
library. You must use the debug libraries when
compiling clients built using the debug C runtime.
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...