Connection modification timeout for mysql in Linux

Source: Internet
Author: User

In Linux, mysql modifies connection timeout 1. First, enter mysql to check whether the value wait_timeout and interactive_timeout is the default 8 hours (that is, 28800) [root @ server110 ~] # Mysql-u root-p Enter password: Enter the password and run the following command: show variables like '% timeout % '; + bytes + ------- + | Variable_name | Value | + bytes + ------- + | connect_timeout | 10 | delayed_insert_timeout | 300 | innodb_lock_wait_timeout | 50 | bytes | OFF | interactive_timeout | 28800 | | net_read_timeout | 30 | net_write_timeout | 60 | slave_net_timeout | 3600 | table_lock_wait_timeout | 50 | wait_timeout | 28800 | + timeout + ------- + as shown in the following table, the connection timeout value is changed by default by 8 hours. in mysql 5 or later versions, you need to modify my. the cnf file is located in/etc/my. the following two sentences are added after [mysqld] for cnf: wait_timeout = 388000 interactive_timeout = 388000 3. restart mysql service mysqld restart. The following information is displayed to stop MySQL: [OK] Start MySQL: [OK] Now you can use the 1 method, view the values of these two parameters + bytes + -------- + | Variable_name | Value | + bytes + -------- + | connect_timeout | 10 | delayed_insert_timeout | 300 | innodb_lock_wait_timeout | 50 | bytes | OFF | interactive_timeout | 388000 | net_read_timeout | 30 | net_write_timeout | 60 | slave_net_timeout | 3600 | table_lock_wait_timeout | 50 | wait_timeout | 388000 | + bytes + -------- + OK, modified

Related Article

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.