我的环境是 centos6.5
在连接数据库的时候发现编译可以通过,但是执行的时候提示下面的保存信息。
error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
解决方法:
在系统搜索找到你的库文件所在位置,在gcc 或Makefile 中引入正确的位置即可。
centos 改为 gcc -o test tst.c -L/usr/lib/mysql 。