mysql错误2005-未知的MySQL服务器主机'localhost'(11001)

问题描述:

我使用的是mysql 5.6.11,它通常会关闭并向我显示:

I was using mysql 5.6.11,it usually turned down and show me this:

2005年-未知的MySQL服务器主机"localhost"(11001).

2005 - Unknown MySQL server host 'localhost'(11001).

目前,我的解决方法是关闭网络,但恢复正常.我进行了很多搜索,但没有找到答案.所以,有人知道原因吗?

Currently my resolution is to turn off the network,than it return to normal.I had searched a lot,but no answer is revalent to it.So,does anyone knows the reason?

错误2005(HY000):未知的MySQL服务器主机'localhost'(0)

ERROR 2005 (HY000): Unknown MySQL server host 'localhost' (0)

修改系统主机名列表:

C:\ Windows \ System32 \ drivers \ etc \ hosts

确保您具有以下条目:

127.0.0.1本地主机
在我的情况下,该条目是0.0.0.0 localhost,这导致了所有问题

127.0.0.1 localhost
In my case that entry was 0.0.0.0 localhost which caussed all problem

(您可能需要更改修改权限才能修改此文件)

(you may need to change modify permission to modify this file)

这会将主机"localhost"的DNS解析为IP地址127.0.0.1.

This performs DNS resolution of host "localhost" to the IP address 127.0.0.1.