Shell Script to auto kill mysql sleep processes

后端 未结 5 698
别跟我提以往
别跟我提以往 2021-02-07 19:29

How We Kill mysql sleep processes Like:

+------+-----------+-----------+------------------------+---------+------+----------------+-----------------------------------         


        
5条回答
  •  别跟我提以往
    2021-02-07 19:32

    A easy way:

    for i in `mysql -e "show processlist" | awk '/Sleep/ {print $1}'` ; do mysql -e "KILL $i;"; done
    

提交回复
热议问题