最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

MySql使用skip-name-resolve解決外網(wǎng)鏈接客戶端過慢問題

 更新時間:2017年07月27日 15:33:15   投稿:mrr  
在騰訊云上面搭建的mysql使用開發(fā)的電腦上navicat進行訪問時總是特別的慢,原來是Mysql會對請求的地址進行域名解析,開發(fā)的電腦并沒有域名,所以會導(dǎo)致特別的慢,下面通過本文給大家分享MySql使用skip-name-resolve解決外網(wǎng)鏈接客戶端過慢問題

在騰訊云上面搭建的mysql使用開發(fā)的電腦上navicat進行訪問時總是特別的慢,原來是Mysql會對請求的地址進行域名解析,開發(fā)的電腦并沒有域名,所以會導(dǎo)致特別的慢,使用以下進行解決

[mysqld]
skip-name-resolve
skip-grant-tables

官方的解釋

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.

根據(jù)文檔說明,如果你的mysql主機查詢DNS很慢或是有很多客戶端主機時會導(dǎo)致連接很慢,由于我們的開發(fā)機器是不能夠連接外網(wǎng)的,所以DNS解析是不可能完成的,從而也就明白了為什么連接那么慢了。同時,請注意在增加該配置參數(shù)后,mysql的授權(quán)表中的host字段就不能夠使用域名而只能夠使用 ip地址了,因為這是禁止了域名解析的結(jié)果。

總結(jié)

以上所述是小編給大家介紹的MySql使用skip-name-resolve解決外網(wǎng)鏈接客戶端過慢問題,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評論

柳州市| 临武县| 昌都县| 独山县| 安化县| 尚志市| 濉溪县| 舒兰市| 镇宁| 桃江县| 丰都县| 关岭| 巴彦县| 安陆市| 西平县| 钟祥市| 公主岭市| 滦平县| 青阳县| 富锦市| 军事| 玉龙| 龙井市| 广安市| 镇坪县| 东丰县| 大同市| 台中市| 阳高县| 连南| 嘉荫县| 昆明市| 布尔津县| 兴海县| 左权县| 台州市| 富顺县| 湘潭市| 仁化县| 禄丰县| 鹰潭市|