I have this config
mysql> SHOW VARIABLES where Variable_name like '%timeout';
+----------------------------+-------+
| Variable_name | Value |
+----------------------------+-------+
| connect_timeout | 5 |
| delayed_insert_timeout | 300 |
| innodb_lock_wait_timeout | 50 |
| innodb_rollback_on_timeout | OFF |
| interactive_timeout | 28800 |
| net_read_timeout | 30 |
| net_write_timeout | 60 |
| slave_net_timeout | 7200 |
| table_lock_wait_timeout | 50 |
| wait_timeout | 28800 |
+----------------------------+-------+
10 rows in set (0.01 sec)
mysql>
I needs long time connect, want to unlimited timeout.
Look my php source.
<?php
$link = @mysql_connect("localhost","root",$pw);
...
mysql_query($query,$link);
...
// A long time flows (maybe 28,800sec)
mysql_query($query,$link); // error !!
?>
Please advise.
The answer is NO. You can not set the wait_timeout to unlimited.
You can refer MYSQL wait_timeout
However if you want to change it then you can try like this:
SET GLOBAL connect_timeout=....;
There is a limit for wait_timeout. This configuartion value can put in the configuration file my.cnf (for unix)/ my.ini (for windows).
Type Integer
Default Value 28800;
Minimum Value 1;
Maximum Value (Other) 31536000;
Maximum Value (Windows) 2147483
Assign wait_timeout in the configuration file within the above range and restart the mysql server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With