https://blog.51cto.com/u_11310506/2071463
show processlist中kill锁表语句与慢sql
1 单个kill
mysql> show processlist;
mysql > kill 251;
#批量kill
1)查找Lockd语句
mysql -uroot -p123456 -h 192.1.20.101 -e "show processlist" | grep -i 'Locked' > locked_log.txt
2)组合kill
for line in `cat locked_log.txt | awk '{print $1}'`
do
echo "kill $line;" >> kill_thread_id.sql
done
3)执行
mysql>source kill_thread_id.sql
-----------------------------------
©著作权归作者所有:来自51CTO博客作者苦逼背锅侠的原创作品,请联系作者获取转载授权,否则将追究法律责任
show processlist中kill锁表语句与慢sql
https://blog.51cto.com/u_11310506/2071463