MySQL报异常:
1:com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after statement closed.
2:org.hibernate.exception.JDBCConnectionException: The last packet successfully received from the server was 74,359,500 milliseconds ago. The last packet sent successfully to the server was 74,359,515 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
会话变量设置/查询:
show variables;
show variables like 'wait_timeout';
select @@session.wait_timeout;
set wait_timeout=10;
set session wait_timeout=10;
----------------------------------------------------------
全局变量设置/查询:
set global wait_timeout=60;
show global variables like 'wait_timeout'
select @@global.wait_timeout;
-[size=1em]--------[size=1em]--------[size=1em]--------[size=1em]--------[size=1em]--------[size=1em]--------[size=1em]
interactive_timeout 也一样设置和查询;