* 通过创建存储过程来执行
CREATE PROCEDURE `kill_long_query_limit`(IN limit_num int)
COMMENT '获得长时间未结束的查询'
BEGIN
SET @sqlcmd1 = CONCAT("SELECT * FROM information_schema.`PROCESSLIST` WHERE id <> CONNECTION_ID() ORDER BY time DESC LIMIT ",limit_num,";");
PREPARE stmt1 FROM @sqlcmd1;
EXECUTE stmt1;
DEALLOCATE PREPARE stmt1;
END;