日本免费全黄少妇一区二区三区-高清无码一区二区三区四区-欧美中文字幕日韩在线观看-国产福利诱惑在线网站-国产中文字幕一区在线-亚洲欧美精品日韩一区-久久国产精品国产精品国产-国产精久久久久久一区二区三区-欧美亚洲国产精品久久久久

mysql 取消DNS的反向解析

mysql 取消DNS的反向解析[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.
PHP遠(yuǎn)程連接MYSQL速度慢,有時(shí)遠(yuǎn)程連接到MYSQL用時(shí)4-20秒不等,本地連接MYSQL正常,出現(xiàn)這種問題的主要原因是,默認(rèn)安裝的MYSQL開啟了DNS的反向解析,在MY.INI(WINDOWS系統(tǒng)下)或MY.CNF(UNIX或LINUX系統(tǒng)下)文件的[mysqld]下加入skip-name-resolve這一句 。
【mysql 取消DNS的反向解析】MYSQL遠(yuǎn)程連接速度慢的解決方法
在局域網(wǎng)內(nèi)連接其他機(jī)器的MYSQL,發(fā)現(xiàn)速度慢的很,不知道什么原因,總有幾秒的延遲.
后來在網(wǎng)上發(fā)現(xiàn)解決方法,my.ini里面添加
[mysqld]
skip-name-resolve
skip-grant-tables
這樣速度就快了!
skip-name-resolve
選項(xiàng)就能禁用DNS解析,連接速度會(huì)快很多 。不過,這樣的話就不能在MySQL的授權(quán)表中使用主機(jī)名了而只能用ip格式 。
若使用–skip-grant-tables系統(tǒng)將對(duì)任何用戶的訪問不做任何訪問控制,但可以用 mysqladmin flush-privileges或mysqladmin reload來開啟訪問控制;默認(rèn)情況是show databases語句對(duì)所有用戶開放,如果mysql服務(wù)器沒有開遠(yuǎn)程帳戶,就在my.ini里面加上skip-grant-tables

    推薦閱讀