mysql設定串連等待時間(wait_timeout)

來源:互聯網
上載者:User

標籤:

Linux下mysql修改連線逾時 1,首先進入mysql,查看 wait_timeout、interactive_timeout這個值是否為預設的8小時(即 28800) [[email protected] ~]# mysql -u root -p Enter password: 輸密碼進入 執行如下命令 show 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 | +----------------------------+-------+ 如下表所示,說明連線逾時時間使用的是預設的8小時 修改之 2.在mysql 5以上的版本需要修改my.cnf這個檔案,這個檔案的位置在 /etc/my.cnf 在[mysqld]後面加上如下兩句話 wait_timeout=388000 interactive_timeout=388000 3.下面重啟下mysql service mysqld restart 顯示如下內容 停止 MySQL:                                               [確定] 啟動 MySQL:                                               [確定] 現在你可以在用1的方法,查看下這兩個參數的值 +----------------------------+--------+ | Variable_name              | Value  | +----------------------------+--------+ | connect_timeout            | 10     | | delayed_insert_timeout     | 300    | | innodb_lock_wait_timeout   | 50     | | innodb_rollback_on_timeout | OFF    | | interactive_timeout        | 388000 | | net_read_timeout           | 30     | | net_write_timeout          | 60     | | slave_net_timeout          | 3600   | | table_lock_wait_timeout    | 50     | | wait_timeout               | 388000 | +----------------------------+--------+ OK,修改好了 

mysql設定串連等待時間(wait_timeout)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.