Deve-se configurar um evento para fechar conexões com mais de 1m aberta
DELIMITER $$
CREATE EVENT IF NOT EXISTS kill_idle_connections
ON SCHEDULE EVERY 1 MINUTE
DO
BEGIN
DECLARE done INT DEFAULT FALSE;
DECLARE a INT;
DECLARE cur1 CURSOR FOR SELECT id FROM information_schema.processlist WHERE Command = 'Sleep' AND Time > 80;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
OPEN cur1;
read_loop: LOOP
FETCH cur1 INTO a;
IF done THEN
LEAVE read_loop;
END IF;
KILL a;
END LOOP;
CLOSE cur1;
END$$
DELIMITER ;