mysql在生产环境下有大量锁表,又不允许重启的情况下的处理办法
满头大汗的宅鸟该怎么办呢?
mysql -u root -e "show processlist"|grep -i "Locked" >> locklist.txt;
for line in awk '{print $1}' locklist.txt
do
echo "kill $line;">>lock_kill.sql
done
不足之处,欢迎拍砖!
2022-09-27 11:57:58
mysql在生产环境下有大量锁表,又不允许重启的情况下的处理办法
满头大汗的宅鸟该怎么办呢?
mysql -u root -e "show processlist"|grep -i "Locked" >> locklist.txt;
for line in awk '{print $1}' locklist.txt
do
echo "kill $line;">>lock_kill.sql
done
不足之处,欢迎拍砖!