真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

MySQL連接超時(shí)相關(guān)的兩個(gè)參數(shù)interactive_timeout和wait_timeout的區(qū)別及解釋

本篇內(nèi)容主要講解“MySQL連接超時(shí)相關(guān)的兩個(gè)參數(shù)interactive_timeout和wait_timeout的區(qū)別及解釋”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實(shí)用性強(qiáng)。下面就讓小編來帶大家學(xué)習(xí)“MySQL連接超時(shí)相關(guān)的兩個(gè)參數(shù)interactive_timeout和wait_timeout的區(qū)別及解釋”吧!

成都網(wǎng)站建設(shè)哪家好,找創(chuàng)新互聯(lián)建站!專注于網(wǎng)頁設(shè)計(jì)、網(wǎng)站建設(shè)公司、微信開發(fā)、成都小程序開發(fā)、集團(tuán)企業(yè)網(wǎng)站建設(shè)等服務(wù)項(xiàng)目。核心團(tuán)隊(duì)均擁有互聯(lián)網(wǎng)行業(yè)多年經(jīng)驗(yàn),服務(wù)眾多知名企業(yè)客戶;涵蓋的客戶類型包括:咖啡廳設(shè)計(jì)等眾多領(lǐng)域,積累了大量豐富的經(jīng)驗(yàn),同時(shí)也獲得了客戶的一致稱贊!

先看看官方文檔對(duì)于這兩個(gè)參數(shù)的定義

interactive_timeout
默認(rèn)是28800,單位秒,即8個(gè)小時(shí)
The number of seconds the server waits for activity on an interactive connection before closing it. An interactive client is defined as a client that uses the CLIENT_INTERACTIVE option to mysql_real_connect(). See also wait_timeout.


wait_timeout
默認(rèn)同樣是28800s
The number of seconds the server waits for activity on a noninteractive connection before closing it.
On thread startup, the session wait_timeout value is initialized from the global wait_timeout value or from the global interactive_timeout value, depending on the type of client (as defined by the CLIENT_INTERACTIVE connect option to mysql_real_connect()). See also interactive_timeout.


interactive_timeout針對(duì)交互式連接,wait_timeout針對(duì)非交互式連接。所謂的交互式連接,即在mysql_real_connect()函數(shù)中使用了CLIENT_INTERACTIVE選項(xiàng)。
說得直白一點(diǎn),通過mysql客戶端連接數(shù)據(jù)庫是交互式連接,通過jdbc連接數(shù)據(jù)庫是非交互式連接。 


interactive_timeout:交互式連接超時(shí)時(shí)間(mysql工具、mysqldump等)
wait_timeout:非交互式連接超時(shí)時(shí)間,默認(rèn)的連接mysql api程序,jdbc連接數(shù)據(jù)庫等
 在連接啟動(dòng)的時(shí)候,根據(jù)連接的類型,來確認(rèn)會(huì)話變量wait_timeout的值是繼承于全局變量wait_timeout,還是interactive_timeout。


如何設(shè)置和查看:
mysql> set global interactive_timeout=1800;
Query OK, 0 rows affected (0.00 sec)


mysql> set global wait_timeout=1800;
Query OK, 0 rows affected (0.00 sec)


mysql> show global variables like 'interactive_timeout';
+---------------------+-------+
| Variable_name       | Value |
+---------------------+-------+
| interactive_timeout | 1800  |
+---------------------+-------+
1 row in set (0.00 sec)


mysql> show global variables like 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout  | 1800  |
+---------------+-------+
1 row in set (0.00 sec)

到此,相信大家對(duì)“MySQL連接超時(shí)相關(guān)的兩個(gè)參數(shù)interactive_timeout和wait_timeout的區(qū)別及解釋”有了更深的了解,不妨來實(shí)際操作一番吧!這里是創(chuàng)新互聯(lián)網(wǎng)站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!


本文標(biāo)題:MySQL連接超時(shí)相關(guān)的兩個(gè)參數(shù)interactive_timeout和wait_timeout的區(qū)別及解釋
文章位置:http://weahome.cn/article/jojeei.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部