[todo] kill a mysql connection which has slept more than a certain time

March 30th, 2011 by xrigher Leave a reply »

here is a script to kill all connections: http://www.coderholic.com/mysql-connection-killer/.

but i need a script for killing all connections that has slept for a period of time.

Also, there are some variables that can be set for shorter connections:

mysql> show variables like “%timeout%”;

and you can set these variables with small values;

mysql> set global  wait_timeout=30;
mysql> set global interactive_timeout=30;


Leave a Reply