2006 - MySQL server has gone away

命令:show global variables like '%timeout';
把以下timeout设置成28800看,都是可以动态设置的。
wait_timeout/interactive_timeout/net_read_timeout/net_write_timeout

命令: set global xxx_timeout=28800;

mysql> show global variables like '%timeout';

+----------------------------+-------+
| Variable_name              | Value |
+----------------------------+-------+
| connect_timeout            | 10    |
| 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          | 3600  |
| table_lock_wait_timeout    | 50    |
| wait_timeout               | 28800 |
+----------------------------+-------+
10 rows in set

mysql> set global wait_timeout=28800;
Query OK, 0 rows affected
mysql> set global interactive_timeout=28800;
Query OK, 0 rows affected
mysql> set global net_read_timeout=28800;
Query OK, 0 rows affected
mysql> set global net_write_timeout=28800;
Query OK, 0 rows affected

 

你可能感兴趣的:(SQL Server)