libmysqlclient.so.16未找到方法

Posted 当幸福来敲门

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了libmysqlclient.so.16未找到方法相关的知识,希望对你有一定的参考价值。

mysql命令登录的时候报错:

[[email protected] www]# mysql -uroot -p
mysql: error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or directory

搜索 libmysqlclient.so.16 但是没有找到这个文件

[[email protected] www]# locate libmysqlclient.so
/data/db_include/mysql5.7/lib/libmysqlclient.so
/data/db_include/mysql5.7/lib/libmysqlclient.so.20
/data/db_include/mysql5.7/lib/libmysqlclient.so.20.3.4
[[email protected] www]# locate libmysqlclient.so.16
[[email protected] www]# locate libmysqlclient.so.16

网上下载了一个 libmysqlclient.so.16  64位的放在了/usr/lib64目录下 下载地址  

[[email protected] www]# rpm -qa | grep Percona
[[email protected] www]# ldd /usr/bin/mysql
/usr/bin/mysql: /usr/lib64/libmysqlclient.so.16: no version information available (required by /usr/bin/mysql)
        linux-vdso.so.1 =>  (0x00007ffd753d8000)
        libncursesw.so.5 => /lib64/libncursesw.so.5 (0x00007f4d9a17e000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f4d99f60000)
        libmysqlclient.so.16 => /usr/lib64/libmysqlclient.so.16 (0x00007f4d99b03000)
        libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f4d998cc000)
        libnsl.so.1 => /lib64/libnsl.so.1 (0x00007f4d996b2000)
        libssl.so.10 => /usr/lib64/libssl.so.10 (0x00007f4d99446000)
        libcrypto.so.10 => /usr/lib64/libcrypto.so.10 (0x00007f4d99061000)
        libz.so.1 => /lib64/libz.so.1 (0x00007f4d98e4a000)
        libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f4d98b44000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f4d988c0000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f4d986a9000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f4d98315000)
        libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007f4d980f4000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f4d97eef000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f4d9a3b2000)
        librt.so.1 => /lib64/librt.so.1 (0x00007f4d97ce7000)
        libfreebl3.so => /lib64/libfreebl3.so (0x00007f4d97ae4000)
        libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f4d9789f000)
        libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f4d975b8000)
        libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007f4d973b4000)
        libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f4d97187000)
        libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007f4d96f7c000)
        libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f4d96d78000)
        libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f4d96b5e000)
        libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f4d9693f000)

继续登录发现还是报错

[[email protected] www]# mysql
mysql: /usr/lib64/libmysqlclient.so.16: no version information available (required by mysql)
mysql: relocation error: mysql: symbol disabled_my_option, version libmysqlclient_16 not defined in file libmysqlclient.so.16 with link time reference

最后解决方法:
原来是以前的文件/usr/bin/mysql没替换的原因
用以下二条命令搞定了。

cd /usr/bin
mv mysql mysql.rpmbak
ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql

再次登录:

[[email protected] bin]# mysql
ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)

参考文档: libmysqlclient问题  

  

  



以上是关于libmysqlclient.so.16未找到方法的主要内容,如果未能解决你的问题,请参考以下文章

MYSQL缺少libmysqlclient.so.16文件

定位 libmysqlclient_r.so.16 问题

ERROR with ​libmysqlclient.so.16 is needed by postfix-2:2.6.6-8.el6.i686 解决办法

linux上卸载mysql遇到的问题

安装 sysbench的 报错 /usr/bin/ld: cannot find -lmysqlclient_r 解决办法

Centos系统下:yum update时出现了一个问题,ERROR with rpm_check_debug vs depsolve