這篇文章主要介紹“MySQL執(zhí)行執(zhí)行pt-query-digest報(bào)錯(cuò)的原因”,在日常操作中,相信很多人在mysql執(zhí)行執(zhí)行pt-query-digest報(bào)錯(cuò)的原因問(wèn)題上存在疑惑,小編查閱了各式資料,整理出簡(jiǎn)單好用的操作方法,希望對(duì)大家解答”mysql執(zhí)行執(zhí)行pt-query-digest報(bào)錯(cuò)的原因”的疑惑有所幫助!接下來(lái),請(qǐng)跟著小編一起來(lái)學(xué)習(xí)吧!
公司主營(yíng)業(yè)務(wù):網(wǎng)站設(shè)計(jì)制作、成都網(wǎng)站制作、移動(dòng)網(wǎng)站開(kāi)發(fā)等業(yè)務(wù)。幫助企業(yè)客戶真正實(shí)現(xiàn)互聯(lián)網(wǎng)宣傳,提高企業(yè)的競(jìng)爭(zhēng)能力。成都創(chuàng)新互聯(lián)公司是一支青春激揚(yáng)、勤奮敬業(yè)、活力青春激揚(yáng)、勤奮敬業(yè)、活力澎湃、和諧高效的團(tuán)隊(duì)。公司秉承以“開(kāi)放、自由、嚴(yán)謹(jǐn)、自律”為核心的企業(yè)文化,感謝他們對(duì)我們的高要求,感謝他們從不同領(lǐng)域給我們帶來(lái)的挑戰(zhàn),讓我們激情的團(tuán)隊(duì)有機(jī)會(huì)用頭腦與智慧不斷的給客戶帶來(lái)驚喜。成都創(chuàng)新互聯(lián)公司推出福州免費(fèi)做網(wǎng)站回饋大家。
操作環(huán)境
問(wèn)題
分析問(wèn)題
操作系統(tǒng)版本
[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
執(zhí)行pt-query-digest報(bào)錯(cuò)
[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.
經(jīng)查baidu與perl的mysql.so庫(kù)文件相關(guān)
[root@three57 percona-toolkit-3.1.0]# locate mysql.so /usr/lib64/perl5/auto/DBD/mysql/mysql.so
分析perl的mysql.so庫(kù)文件的依賴庫(kù)是否完整,可見(jiàn)缺失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 確實(shí)沒(méi)找到mysql動(dòng)態(tài)鏈接庫(kù) 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這種庫(kù)文件源于mysql安裝介質(zhì)
查詢已安裝的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庫(kù)文件
[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
綜上所述,應(yīng)該需要安裝mysql軟件包mysql-community-libs-compat
(注:它是提供mysql舊版本的共享庫(kù)文件)
[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
執(zhí)行l(wèi)dd /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)
到此,關(guān)于“mysql執(zhí)行執(zhí)行pt-query-digest報(bào)錯(cuò)的原因”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實(shí)踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識(shí),請(qǐng)繼續(xù)關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編會(huì)繼續(xù)努力為大家?guī)?lái)更多實(shí)用的文章!