MYSQL四個timeout參數的含義 4個timeout都是為了防止某一個鏈接長時間占用一數據庫的描述符,又不干事情,或者網絡有問題沒有釋放這個描述符,線程阻塞種種資源浪費的情況.我們要主動的"卡"掉對端! www.2cto.com 首先看看這4個timeout在mysql5.1手冊裡的英文解釋: connect_timeout The number of seconds that the mysqld server waits for a connect packet before responding with Bad handshake. interactive_timeout The number of seconds the server waits for activity on an interactive connection before closing it. wait_timeout The number of seconds the server waits for activity on a noninteractive connection before closing it. net_read_timeout The number of seconds to wait for more data from a connection before aborting the read. net_write_timeout The number of seconds to wait for a block to be written to a connection before aborting the write. 從意思上可以理解為 connect_timeout在獲取連接階段(authenticate)起作用, interactive_timeout和wait_timeout在連接空閒階段(sleep)起作用, net_read_timeout和net_write_timeout在連接繁忙階段(query)起作用。