About Wait_timeout
Once went to online set wait_timeout when found changed does not take effect, as follows:
Mysql> Show variables like ' wait_timeout ';
+---------------+-------+
| variable_name | Value |
+---------------+-------+
| Wait_timeout | 100 |
+---------------+-------+
1 row in Set (0.00 sec)
mysql> set global wait_timeout=28800;
Query OK, 0 rows Affected (0.00 sec)
Mysql> exit
Bye
Log back in to MySQL after exiting
Mysql> Show variables like ' wait_timeout ';
+---------------+-------+
| variable_name | Value |
+---------------+-------+
| Wait_timeout | 100 |
+---------------+-------+
1 row in Set (0.00 sec)
Search the Internet for a moment:
The default values for 1:interactive_timeout and Wait_timeout are 28800 (8 hours) when the two parameters appear in the same time, the value of interactive_timeout will prevail. That is, no matter what the value of wait_timeout, use show variables like '%timeout% '; the two values shown are the same, and both are interactive_timeout values.
Myth 2: If the query is using show variables, you will find that the settings do not appear to be in effect, because the simple use of show variables is equivalent to using the show session variables, the query is session variables, Only the global variable is queried using show global variables. Many people on the web complain that they have not found a change after set global using Show variables query, because they confuse session variables and global variables, and if you just want to modify session variables, you can use a set wait_timeout=10 or set session wait_timeout=10; Such a grammar.
Verify the Argument 1: Modify the Interactive_timeout to achieve the effect of modifying wait_timeout
Mysql>Show variables like '%timeout ';
+-------------------------+-------+
| variable_name | Value |
+-------------------------+-------+
| Connect_timeout | 10 |
| Delayed_insert_timeout | 300 |
| interactive_timeout | 200 |
| Net_read_timeout | 30 |
| Net_write_timeout | 60 |
| Slave_net_timeout | 3600 |
| Table_lock_wait_timeout | 50 |
| wait_timeout | 200 |
+-------------------------+-------+
8 rows in Set (0.00 sec)
Mysql> set global interactive_timeout=100;
Query OK, 0 rows Affected (0.00 sec)
Mysql>Show variables like '%timeout ';
+-------------------------+-------+
| variable_name | Value |
+-------------------------+-------+
| Connect_timeout | 10 |
| Delayed_insert_timeout | 300 |
| Interactive_timeout | 200 |
| Net_read_timeout | 30 |
| Net_write_timeout | 60 |
| Slave_net_timeout | 3600 |
| Table_lock_wait_timeout | 50 |
| wait_timeout | 200 |
+-------------------------+-------+
8 rows in Set (0.00 sec)
Mysql>Show global variables like '%timeout ';
+-------------------------+-------+
| variable_name | Value |
+-------------------------+-------+
| Connect_timeout | 10 |
| Delayed_insert_timeout | 300 |
| interactive_timeout | 100 |
| Net_read_timeout | 30 |
| Net_write_timeout | 60 |
| Slave_net_timeout | 3600 |
| Table_lock_wait_timeout | 50 |
| wait_timeout | 200 |
+-------------------------+-------+
8 rows in Set (0.00 sec)
Mysql> exit
Bye
Log back in to MySQL after exiting
Mysql>Show variables like '%timeout ';
+-------------------------+-------+
| variable_name | Value |
+-------------------------+-------+
| Connect_timeout | 10 |
| Delayed_insert_timeout | 300 |
| interactive_timeout | 100 |
| Net_read_timeout | 30 |
| Net_write_timeout | 60 |
| Slave_net_timeout | 3600 |
| Table_lock_wait_timeout | 50 |
| wait_timeout | 100 |
+-------------------------+-------+
8 rows in Set (0.00 sec)
Mysql>
Above can be seen, if modify interactive_timeout words Wait_timeout will also follow change, and only modify wait_timeout is not effective.
Turn from
Questions about MySQL wait_timeout parameter settings not in effect-ㄓㄤㄑㄧㄤ-Blog Park
Http://www.cnblogs.com/azhqiang/p/5454000.html
Questions about MySQL's wait_timeout parameter setting do not take effect "go"