error while loading shared libraries: libmysql....

  ERROR:./a.out: error while loading shared libraries: libmysql.so.16: cannot open shared object file: No such file or directory

 1>  libmysql.so.16 安装在 /usr/local/mysql/lib

    可以从下载目录复制过来:

    sudo mkdir -p /usr/local/mysql/lib/connector-c-6.0.2-linux-glibc2.3-x86-32bit/

    sudo cp -R workspace/ck/mysql-connector-c-6.0.2-linux-glibc2.3-x86-32bit/*  /usr/local/mysql/lib/connector-c-6.0.2-linux-glibc2.3-x86-32bit/.


 2> 编辑sudo  vi /etc/ld.so.conf

include ld.so.conf.d/*.conf
/usr/local/mysql/lib/connector-c-6.0.2-linux-glibc2.3-x86-32bit/lib/     //添加这一行

3>sudo ldconfig      //建立libray缓存

再运行程序,ok。运行时so库找到了。

你可能感兴趣的:(error while loading shared libraries: libmysql....)