日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

遠(yuǎn)程連接MySQL速度慢的解決辦法

系統(tǒng) 2155 0

skip-name-resolve

?

現(xiàn)象:

Windows 2003下的MySQL 5服務(wù)器,本機(jī)連接到MySQL服務(wù)非常快,局域網(wǎng)內(nèi)有兩臺(tái)Linux機(jī)器,有一臺(tái)連接很快,另外一臺(tái)輸入密碼后要等好幾秒鐘才能連上。

解決辦法:

在MySQL服務(wù)器的配置中增加一個(gè)如下配置后速度飛快。

[mysqld]
skip-name-resolve


附錄:( How MySQL uses DNS )

When a new thread connects to mysqld, mysqld will spawn a new thread to handle the request. This thread will first check if the hostname is in the hostname cache. If not the thread will call gethostbyaddr_r() and gethostbyname_r() to resolve the hostname.

If the operating system doesn't support the above thread-safe calls, the thread will lock a mutex and call gethostbyaddr() and gethostbyname() instead. Note that in this case no other thread can resolve other hostnames that is not in the hostname cache until the first thread is ready.

You can disable DNS host lookup by starting mysqld with --skip-name-resolve. In this case you can however only use IP names in the MySQL privilege tables.

If you have a very slow DNS and many hosts, you can get more performance by either disabling DNS lookop with --skip-name-resolve or by increasing the HOST_CACHE_SIZE define (default: 128) and recompile mysqld.

You can disable the hostname cache with --skip-host-cache. You can clear the hostname cache with FLUSH HOSTS or mysqladmin flush-hosts.

If you don't want to allow connections over TCP/IP, you can do this by starting mysqld with --skip-networking

遠(yuǎn)程連接MySQL速度慢的解決辦法


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號(hào)聯(lián)系: 360901061

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對(duì)您有幫助就好】

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對(duì)您有幫助,請(qǐng)用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長(zhǎng)會(huì)非常 感謝您的哦!!!

發(fā)表我的評(píng)論
最新評(píng)論 總共0條評(píng)論
主站蜘蛛池模板: 济宁市| 邳州市| 昌江| 北海市| 虎林市| 涟水县| 喀什市| 台东市| 丹凤县| 潮安县| 齐齐哈尔市| 图木舒克市| 台北市| 怀远县| 商南县| 布尔津县| 卢氏县| 江城| 图们市| 五指山市| 孟村| 航空| 尼勒克县| 图木舒克市| 灌南县| 诸城市| 万载县| 颍上县| 和龙市| 彩票| 延川县| 仙桃市| 罗田县| 佛山市| 永嘉县| 朝阳区| 新田县| 东城区| 津市市| 凤山市| 华安县|