1、下載percona-toolkit-2.2.16.tar.gz
# wget
https://www.percona.com/downloads/percona-toolkit/2.2.16/tarball/percona-toolkit-2.2.16.tar.gz
2、安裝
# ll
-rw-r--r-- 1 root root 1408239 11月 9 2015 percona-toolkit-2.2.16.tar.gz
# tar xf percona-toolkit-2.2.16.tar.gz
# cd percona-toolkit-2.2.16
# perl Makefile.PL
# yum -y install perl
# yum -y install perl-ExtUtils-MakeMaker.x86_64
# yum -y install perl-DBI.x86_64
# yum -y install perl-DBD-MySQL.x86_64
# perl Makefile.PL
# make
# make install
# yum -y install perl-Time-HiRes.x86_64
# /usr/local/bin/pt-kill -S /tmp/mysql.sock -u root -p"123456" \
--match-info "^(select|SELECT|Select)" \
--busy-time 5 --victim all --interval 3 --kill-query --print \
--log /usr/local/src/kill.txt --daemonize
--socket=s -S Socket file to use for connection
--user=s -u User for login if not current user
--password=s -p Password to use when connecting
--match-info=s Match only queries whose Info (query) matches this Perl regex
--busy-time=m Match queries that have been running for longer than
this time. Optional suffix s=seconds, m=minutes, h=
hours, d=days; if no suffix, s is used.
--interval=m How often to check for queries to kill. Optional
suffix s=seconds, m=minutes, h=hours, d=days; if no
suffix, s is used.
--victims=s Which of the matching queries in each class will be
killed (default oldest)
Actions:
--execute-command=s Execute this command when a query matches
--kill Kill the connection for matching queries
--kill-query Kill matching queries
--print Print a KILL statement for matching queries; does not
actually kill queries
--log=s Print all output to this file when daemonized
--daemonize Fork to the background and detach from the shell
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。