Home >Database >Mysql Tutorial >在win7中, 使用localhost连接mysql速度慢的解决方法

在win7中, 使用localhost连接mysql速度慢的解决方法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 15:34:131438browse

作者: 溪水清澈 在 c:\windows\system32\drivers\etc\hosts 文件中 , 把 127.0.0.1 localhost 这一句添加上即可 . 原因猜测 : mysql 在默认情况下 , 会开启对 DNS 的反向解析 , 即 配置信息 skip-name-resolve=false 而在 win7 中 , 默认情况下 , 在 hosts

作者: 溪水清澈

 

c:\windows\system32\drivers\etc\hosts文件中,

127.0.0.1    localhost  这一句添加上即可.

 

原因猜测:

mysql在默认情况下, 会开启对DNS的反向解析,

配置信息 skip-name-resolve=false

而在win7, 默认情况下, hosts 文件中,

localhost  127.0.0.1 这一行注释掉了,

那么使用 localhost来连接mysql, 有趣的事情就发生了,

mysql反向解析localhost, 明显解析不到,

只有等待 1秒的超时时间

连接速度也就慢了.

 

有个问题不理解, 为什么别的程序可以使用localhost,

mysql不行?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn