https://dev.mysql.com/doc/refman/5.5/en/c-api.html
libmysqlclient
libmysqld
-
On Unix (and Unix-like) sytems, the static library is
libmysqlclient.a
. The dynamic library islibmysqlclient.so
on most Unix systems andlibmysqlclient.dylib
on OS X.For distributions that include embedded server libraries, the corresponding library names begin with
libmysqld
rather thanlibmysqlclient
.
On Unix, you may also see libraries that include _r
in the names. Before MySQL 5.5, these were built as thread-safe (re-entrant) libraries separately from the non-_r
libraries. As of 5.5, both libraries are the same and the _r
names are symbolic links to the corresponding non-_r
names. There is no need to use the_r
libraries.
:~$ ls -lah /usr/lib/x86_64-linux-gnu/libmysqlclient*
-rw-r--r-- 1 root root 4.6M Oct 22 22:24 /usr/lib/x86_64-linux-gnu/libmysqlclient.a
lrwxrwxrwx 1 root root 16 Oct 22 22:23 /usr/lib/x86_64-linux-gnu/libmysqlclient_r.a -> libmysqlclient.a
lrwxrwxrwx 1 root root 17 Oct 22 22:23 /usr/lib/x86_64-linux-gnu/libmysqlclient_r.so -> libmysqlclient.so
lrwxrwxrwx 1 root root 20 Oct 22 22:23 /usr/lib/x86_64-linux-gnu/libmysqlclient_r.so.18 -> libmysqlclient.so.18
lrwxrwxrwx 1 root root 24 Oct 22 22:23 /usr/lib/x86_64-linux-gnu/libmysqlclient_r.so.18.0.0 -> libmysqlclient.so.18.0.0
lrwxrwxrwx 1 root root 20 Oct 22 22:23 /usr/lib/x86_64-linux-gnu/libmysqlclient.so -> libmysqlclient.so.18
lrwxrwxrwx 1 root root 24 Oct 22 22:23 /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18 -> libmysqlclient.so.18.0.0
-rw-r--r-- 1 root root 3.2M Oct 22 22:24 /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18.0.0
安装
apt-get install libmysqlclient-dev