mysql_cmd=mysql
host=127.0.0.1
user=abc
password=123
port=3306
kill_process=$($mysql_cmd -h $host -u $user -p $password -P $port -e 'show processlist' | grep -i "lock" | awk '{if(NR>1'"${check}"') print $1}');
echo ${kill_process}
for process_id in $kill_process
do
$mysql_cmd -h $host -u $user -p $password -P $port -e 'kill '"${process_id}"
done
杀死锁表进程的脚本
最新推荐文章于 2021-05-27 16:43:49 发布