当前位置:Gxlcms > mysql > mysql-<SOS!!!>Communicationslinkfailureons

mysql-<SOS!!!>Communicationslinkfailureons

时间:2021-07-01 10:21:17 帮助过:32人阅读

mysqlhibernatefailure

自己做的第一个信息类网站,第一次访问主页时能够正确显示,但过几分钟后刷新该页面是就会报错:错误类型如下:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 1,649,969 milliseconds ago. The last packet sent successfully to the server was 2 milliseconds ago

.
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
java.lang.reflect.Constructor.newInstance(Constructor.java:513)
com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1127)
com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3715)
在网上查了一些解决方案,比如设置mysql参数“wait_timeout”等等都不奏效。求大神指点。。(ps: 用的是Hibernate访问数据库,MySQL版本为5.6的)

人气教程排行