Manual cleanup:
- Login to MySQL
mysql -uroot -p
- Run the following query
select concat(‘KILL ‘,id,’;’) from information_schema.processlist where Command=’Sleep’;
- Copy the query result, paste and remove a pipe ‘ | ‘ sign, copy, and paste all again into the query console
- Hit ENTER
Automatic cleanup:
- Configure mysql-server by setting a shorter timeout on
wait_timeoutandinteractive_timeout - Check your existing configuration using the following command
show variables like “%timeout%”;
- Set with:
set global wait_timeout=3; set global interactive_timeout=3;
exactly what i needed. thank you!
This works in smart way and easy to understand. Thank you.