ubuntu libmysqlclient.so文件在啥地方

Posted

tags:

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

参考技术A 安装apt-file
运行sudo apt-file update
然后运行sudo apt-file search libmysqlclient.so
就找到那个软件包包含 libmysqlclient.so,同时也告诉了你相应的路径本回答被提问者和网友采纳
参考技术B 这是麻烦事情。
find . -name libmysqlclient.so
吾找到的目录是:
./usr/lib/x86_64-linux-gnu/libmysqlclient.so

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问题  

  

  



以上是关于ubuntu libmysqlclient.so文件在啥地方的主要内容,如果未能解决你的问题,请参考以下文章

LoadError:MySQL2 gem 问题,Ubuntu LTS 20.04 上的 libmysqlclient.so.20 版本不正确

mysql2.so:libmysqlclient_r.so.15:无法打开共享对象文件:没有这样的文件或目录

libmysqlclient.so.16未找到方法

MYSQL缺少libmysqlclient.so.16文件

error while loading shared libraries:libmysqlclient.so.18 错误

定位 libmysqlclient_r.so.16 问题