MySQL Forums
Forum List  »  Newbie

Change wait_timeout parameter
Posted by: Luís de Sousa
Date: November 29, 2011 02:46AM

Dear all,

I recently inherited a web application that uses several mySQL databases. Right before I came on board a test server was setup with both mySQL and the web server (Tomcat) installed. It happens that every morning the application must be restarted, it hangs up every night. This message, which must be known to those familiar with mySQL, is showing up in catalina.out:

Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 82,966,646 milliseconds ago. The last packet sent successfully to the server was 82,966,647 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.

Following the documentation, I edited the <i>/etc/mysql/my.cnf</i> file and restarted mySQL so that now this parameter is set to a much higher value than the default:

$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 71
Server version: 5.1.41-3ubuntu12.10 (Ubuntu)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SHOW VARIABLES LIKE 'wait_timeout';
| Variable_name | Value |
| wait_timeout | 700000 |
1 row in set (0.00 sec)

The problem is that the application continues to hang up during the night, producing the exact same error as before. There is the work-around of using the "autoReconnect=true" parameter in the connection string, but that seems to be advised against be the mySQL documentation.

Any further insight on this situation would be appreciated. Thank you.

Options: ReplyQuote

Written By
Change wait_timeout parameter
November 29, 2011 02:46AM
December 04, 2011 07:19PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.