您好,登錄后才能下訂單哦!
這篇文章主要介紹“mysql執行執行pt-query-digest報錯的原因”,在日常操作中,相信很多人在mysql執行執行pt-query-digest報錯的原因問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”mysql執行執行pt-query-digest報錯的原因”的疑惑有所幫助!接下來,請跟著小編一起來學習吧!
操作環境
問題
分析問題
操作系統版本
[root@three57 mysql57_dir]# more /etc/redhat-release Red Hat Enterprise Linux Server release 6.8 (Santiago)
pt-query-digest版本
[root@three57 mysql57_dir]# pt-query-digest --version pt-query-digest 3.1.0
執行pt-query-digest報錯
[root@three57 percona-toolkit-3.1.0]# pt-query-digest --interval=2 --processlist -uroot -psystem Reading from STDIN ... install_driver(mysql) failed: Attempt to reload DBD/mysql.pm aborted. Compilation failed in require at (eval 23) line 3.
經查baidu與perl的mysql.so庫文件相關
[root@three57 percona-toolkit-3.1.0]# locate mysql.so /usr/lib64/perl5/auto/DBD/mysql/mysql.so
分析perl的mysql.so庫文件的依賴庫是否完整,可見缺失libmysqlclient.so.16
[root@three57 percona-toolkit-3.1.0]# ldd /usr/lib64/perl5/auto/DBD/mysql/mysql.so linux-vdso.so.1 => (0x00007ffcf6dd4000) libmysqlclient.so.16 => not found 確實沒找到mysql動態鏈接庫 libz.so.1 => /lib64/libz.so.1 (0x00007f9b0e1cb000) libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f9b0df94000) libnsl.so.1 => /lib64/libnsl.so.1 (0x00007f9b0dd7b000) libm.so.6 => /lib64/libm.so.6 (0x00007f9b0daf6000) libssl.so.10 => /usr/lib64/libssl.so.10 (0x00007f9b0d88a000) libcrypto.so.10 => /usr/lib64/libcrypto.so.10 (0x00007f9b0d4a6000) libc.so.6 => /lib64/libc.so.6 (0x00007f9b0d111000) libfreebl3.so => /lib64/libfreebl3.so (0x00007f9b0cf0e000) libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f9b0ccca000) libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f9b0c9e2000) libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007f9b0c7de000) libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f9b0c5b2000) libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f9b0c397000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f9b0c193000) /lib64/ld-linux-x86-64.so.2 (0x000000381da00000) libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007f9b0bf88000) libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f9b0bd84000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f9b0bb67000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f9b0b947000)
libmysqlclient.so這種庫文件源于mysql安裝介質
查詢已安裝的mysql軟件包
[root@three57 mysql57_dir]# rpm -qa|grep -i --color mysql mysql-community-common-5.7.21-1.el6.x86_64 mysql-community-server-5.7.21-1.el6.x86_64 perl-DBD-MySQL-4.013-3.el6.x86_64 mysql-community-libs-5.7.21-1.el6.x86_64 mysql-community-client-5.7.21-1.el6.x86_64
查詢已安裝的libmysqlclient庫文件
[root@three57 mysql57_dir]# locate /usr/lib64/mysql/libmysqlclient.so.20 /usr/lib64/mysql/libmysqlclient.so.20 /usr/lib64/mysql/libmysqlclient.so.20.3.8
綜上所述,應該需要安裝mysql軟件包mysql-community-libs-compat
(注:它是提供mysql舊版本的共享庫文件)
[root@three57 mysql57_dir]# rpm -ivh mysql-community-libs-compat-5.7.21-1.el6.x86_64.rpm warning: mysql-community-libs-compat-5.7.21-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ########################################### [100%] 1:mysql-community-libs-co########################################### [100%] [root@three57 mysql57_dir]# locate libmysqlclient.so.16 /usr/lib64/mysql/libmysqlclient.so.16 /usr/lib64/mysql/libmysqlclient.so.16.0.0
執行ldd /usr/lib64/perl5/auto/DBD/mysql/mysql.so正常
[root@three57 mysql57_dir]# ldd /usr/lib64/perl5/auto/DBD/mysql/mysql.so linux-vdso.so.1 => (0x00007ffd3fee9000) libmysqlclient.so.16 => /usr/lib64/mysql/libmysqlclient.so.16 (0x00007f346d4e3000) libz.so.1 => /lib64/libz.so.1 (0x00007f346d2cd000) libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f346d095000) libnsl.so.1 => /lib64/libnsl.so.1 (0x00007f346ce7c000) libm.so.6 => /lib64/libm.so.6 (0x00007f346cbf8000) libssl.so.10 => /usr/lib64/libssl.so.10 (0x00007f346c98b000) libcrypto.so.10 => /usr/lib64/libcrypto.so.10 (0x00007f346c5a7000) libc.so.6 => /lib64/libc.so.6 (0x00007f346c213000) libfreebl3.so => /lib64/libfreebl3.so (0x00007f346c00f000) libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f346bdcb000) libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f346bae4000) libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007f346b8df000) libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f346b6b3000) libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f346b499000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f346b294000) /lib64/ld-linux-x86-64.so.2 (0x000000381da00000) libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007f346b089000) libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f346ae86000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f346ac68000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f346aa49000)
到此,關于“mysql執行執行pt-query-digest報錯的原因”的學習就結束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學習,快去試試吧!若想繼續學習更多相關知識,請繼續關注億速云網站,小編會繼續努力為大家帶來更多實用的文章!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。