一条语句kill 多条mysql语句

 

If information_schema.processlist doesn’t exist on your version of MySQL, this works in a linux script:

#!/bin/bash
for each in mysqladmin -u root -prootpwd processlist | awk '{print $2, $4, $8}' | grep $dbname | grep $dbuser | awk '{print $1}';
do mysqladmin -u root -prootpwd kill $each;
done

posted on 2017-09-27 09:31  dongruiha  阅读(711)  评论(0编辑  收藏  举报

导航