MySQL Setting connection wait time (wait_timeout)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.