In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article is about how MySQL uses pt-kill to kill big SQL. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Download address
Https://www.percona.com/downloads/percona-toolkit/LATEST/
Decompress pt software
# tar xfz percona-toolkit-3.0.2_x86_64.tar.gz
Install the corresponding perl dependency package
# yum install perl-DBI
# yum install perl-DBD-MySQL
# execute a big SQL
> select * from ls_evaluate
# print out statements that take more than 2 seconds to execute
# bin/pt-kill-uroot-pcnstrong#123454321-S / data/mysql01/mysql.sock-- busy-time 2-- print
# 2018-02-12T11:28:04 KILL 30192 (Query 41 sec) select * from ls_evaluate
# 2018-02-12T11:28:05 KILL 30192 (Query 42 sec) select * from ls_evaluate
# 2018-02-12T11:28:06 KILL 30192 (Query 43 sec) select * from ls_evaluate
# kill statements that have been executed for more than 2 seconds
# bin/pt-kill-uroot-pcnstrong#123454321-S / data/mysql01/mysql.sock-- busy-time 2-- kill
# SQL session disconnected
> select * from ls_evaluate
ERROR 2013 (HY000): Lost connection to MySQL server during query
# kill large queries in the database that take more than 30 seconds to execute every 10 seconds
# bin/pt-kill-uroot-pcnstrong#123454321-S / data/mysql01/mysql.sock-busy-time 30-- kill-- interval 10
Thank you for reading! This is the end of this article on "how MySQL uses pt-kill to kill Big SQL". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.