mysql eight hours issue

Java program to connect MySQL database, you receive the following error, the error message is as follows: Communications link failure due to underlying exception: java.io.EOFException at com.mysql.jdbc.MysqlIO.readFully (MysqlIO.java:1913) at com .mysql.jdbc.MysqlIO.reuseAndReadPacket (MysqlIO.java:2304) at com.mysql.jdbc.MysqlIO.checkErrorPacket (MysqlIO.java:2803) at com.mysql.jdbc.MysqlIO.sendCommand (MysqlIO.java:1573) produced the reason for this is that when the application and the database connection is established when, if more than eight hours, the application statements do not access the database, the database will break the connection. If at this time once again to access the database above error message appears. This is the "impeccable same name," the problem MySQL eight hours. The solution: increase interactive_timeout value set global interactive_timeout = 288000 # vi /etc/my.cnf [mysqld] interactive_timeout = 288000

Reproduced in: https: //my.oschina.net/766/blog/211397

Guess you like

Origin blog.csdn.net/weixin_33709590/article/details/91546232