快捷搜索:  as  2018  FtCWSyGV  С˵  test  xxx  Ψһ  w3viyKQx

丽星邮轮电子游戏:The last packet successfully received from the server was52536 seconds ago



The last packet successfully received from the server was52536 seconds ago.The last packet sent successfully to the server was 52536 seconds ago, whichis 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.

问:如何才能办理mysql 8小时余暇后连接超时的问题?

答:当利用法度榜样和数据库建立连接时,假如跨越了8个小时,利用法度榜样句不会去造访数据库,数据库就会呈现断掉落连接的征象 。这时再次造访就会抛出非常,非常如下:

Communications link failure due to

underlying exception:

** BEGIN NESTED EXCEPTI丽星邮轮电子游戏ON **

java.io.EOFException

STACKTRACE:

java.io.EOFException

at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1913)

at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlI丽星邮轮电子游戏O.java:2304)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2803)

at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)

...

一样平常的办理措施大年夜多是在数据库连接字符串中增添“a丽星邮轮电子游戏utoReconnect=true ”选项。然则这只对mysql4曩昔的版本有效。在最新的mysql中是无效的。着实要办理这个问题也有一个简单的措施,便是改动mysql的启动参数。缺省环境下mysql的timeout光阴是28800秒,恰正是8小时,增添一个0就可以了。

同理也可以在" my.ini"文件中增添此参数。

mysqld-nt --default-table-type=inn丽星邮轮电子游戏odb --interactive_tim丽星邮轮电子游戏eout=288000

您可能还会对下面的文章感兴趣: