Linux under MySQL Modify connection timeout 1, first into MySQL, see wait_timeout, interactive_timeout Whether this value is the default 8 hours (that is 28800) [[email Protected] ~]# mysql-u root-p enter password: input Password Enter Execute the following command show variables like '%timeout% '; +----------------------------+-------+ | Variable_name | Value | +----------------------------+-------+ | Connect_timeout | Ten | | Delayed_insert_timeout | | | Innodb_lock_wait_timeout | | | Innodb_rollback_on_timeout | OFF | | Interactive_timeout | 28800 | | Net_read_timeout | | | Net_write_timeout | | | Slave_net_timeout | 3600 | | Table_lock_wait_timeout | | | Wait_timeout | 28800 | +----------------------------+-------+ is shown in the following table, indicating that the connection time-out is using the default 8-hour modified 2. in MySQL More than 5 of the version needs to be modified my.cnf this file, the location of this file in /etc/my.cnf after [mysqld] add the following two words wait_timeout=388000 Interactive_timeout=388000 3. Below reboot under Mysql service mysqld restart show the following stop MySQL: , &NB Sp [OK] start MySQL: &NBS P [OK] now you can use the 1 method to see the values of the two parameters +----- -----------------------+--------+ | Variable_name | Value | +----------------------------+--------+ | Connect_timeout | Ten &NBsp | | Delayed_insert_timeout | | | Innodb_lock_wait_timeout | | | Innodb_rollback_on_timeout | OFF | | Interactive_timeout | 388000 | | Net_read_timeout | | | Net_write_timeout | | | Slave_net_timeout | 3600 | | Table_lock_wait_timeout | | | Wait_timeout | 388000 | +----------------------------+--------+ ok, modified
MySQL Setting connection wait time (wait_timeout)