Kill all threads from a MySQL user
mysql -BNe "SELECT id FROM processlist WHERE user = 'redmine';" information_schema | while read id; do mysqladmin kill $id; done
Kill all threads from a MySQL user
Kills all the threads from the user provided in the WHERE request.
Alternatives
for i in `mysqladmin -h x.x.x.x --user=root -pXXXX processlist | grep <<username>>| grep <<Locked>>| awk {'print $2'}` do mysqladmin -h x.x.x.x --user=root -pXXX kill $i; done;
No comments:
Post a Comment