How can I see / change MySQL connection timeout settings?

SET SESSION wait_timeout = 999999;//or anything you want

From mysql command line that will increase the timeout value. To be able to see the value:

SHOW VARIABLES LIKE 'wait_timeout';

You can make this request to show your timeout in MySql

SHOW VARIABLES LIKE 'connect_timeout';

Next you can update it to 60 secondes for exemple

SET GLOBAL connect_timeout=60;

If the problem is the Query you can use Statement.setQueryTimeout


You can set wait_timeout NET_read_timeout and connect_timeout for resolve the problem in following way.

SHOW VARIABLES LIKE 'wait_timeout'; SET SESSION wait_timeout = 999999;

SHOW variables LIKE 'NET_read_timeout'; SET SESSION net_read_timeout = 1000;

SHOW VARIABLES LIKE 'connect_timeout'; SET GLOBAL connect_timeout = 1000;

Tags:

Mysql

Java