linux 下使用c语言访问mysqlclient
locate -r mysqlcli
/root/sh-1.5.5/mysql/mysql-5.6.21-linux-glibc2.5-x86_64/lib/libmysqlclient.a
/root/sh-1.5.5/mysql/mysql-5.6.21-linux-glibc2.5-x86_64/lib/libmysqlclient.so
/root/sh-1.5.5/mysql/mysql-5.6.21-linux-glibc2.5-x86_64/lib/libmysqlclient.so.18
/root/sh-1.5.5/mysql/mysql-5.6.21-linux-glibc2.5-x86_64/lib/libmysqlclient.so.18.1.0
/root/sh-1.5.5/mysql/mysql-5.6.21-linux-glibc2.5-x86_64/lib/libmysqlclient_r.a
/root/sh-1.5.5/mysql/mysql-5.6.21-linux-glibc2.5-x86_64/lib/libmysqlclient_r.so
/root/sh-1.5.5/mysql/mysql-5.6.21-linux-glibc2.5-x86_64/lib/libmysqlclient_r.so.18
/root/sh-1.5.5/mysql/mysql-5.6.21-linux-glibc2.5-x86_64/lib/libmysqlclient_r.so.18.1.0
/usr/local/mysql/lib/libmysqlclient.a
/usr/local/mysql/lib/libmysqlclient.so
/usr/local/mysql/lib/libmysqlclient.so.20
/usr/local/mysql/lib/libmysqlclient.so.20.3.5
/usr/local/mysql/lib/pkgconfig/mysqlclient.pc
/# find . -name mysql.h
./root/sh-1.5.5/mysql/mysql-5.6.21-linux-glibc2.5-x86_64/include/mysql.h
./usr/local/mysql/include/mysql.h
那么在makefile 下加链接
LIBS += -L/usr/local/mysql/lib/ -lz
LIBS += -lmysqlclient