国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > MySQL > 正文

解決遠程連接mysql很慢的方法(mysql

2024-07-24 12:41:43
字體:
來源:轉載
供稿:網友
在進行 ping和route后發現網絡通信都是正常的,而且在mysql機器上進行本地連接發現是很快的,所以網絡問題基本上被排除了。以前也遇到過一次這樣的問題,可后來就不知怎么突然好了,這次又遭遇這樣的問題,所以想看看是不是mysql的配置問題。在查詢mysql相關文檔和網絡搜索后,發現了一個配置似乎可以解決這樣的問題,就是在mysql的配置文件中增加如下配置參數:

[mysqld]
skip-name-resolve

      在linux下配置文件是/etc/my.cnf,在windows下配置文件是mysql安裝目錄下的my.ini文件。注意該配置是加在 [mysqld]下面,在更改配置并保存后,然后重啟mysql并遠程連接測試,一切恢復如初。該參數的官方解釋信息如下:

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

主站蜘蛛池模板: 济阳县| 扎赉特旗| 海口市| 大庆市| 丹棱县| 芷江| 巧家县| 泗水县| 南溪县| 托克逊县| 贺兰县| 庄河市| 河曲县| 金坛市| 曲水县| 称多县| 怀柔区| 绵竹市| 莱西市| 晋城| 丹寨县| 中超| 繁昌县| 中江县| 谢通门县| 沙雅县| 崇文区| 建湖县| 广丰县| 南漳县| 富源县| 梅州市| 普格县| 老河口市| 全州县| 磐安县| 陇川县| 达拉特旗| 封丘县| 行唐县| 报价|