首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >mysql error 2005 - Unknown MySQL server host 'localhost'(11001)

mysql error 2005 - Unknown MySQL server host 'localhost'(11001)

作者头像
yuanyuan
发布2019-09-10 18:02:08
发布2019-09-10 18:02:08
4.9K0
举报
文章被收录于专栏:小满小满

有的时候偶尔会出现这个问题 2005 Unknown MySQL server host 'localhost' (11001),刚开始重启电脑ok了,但是不能每次出现这个问题就重启电脑吧,太麻烦了,总得找到原因。

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

修改文件C:\Windows\System32\drivers\etc\hosts

添加127.0.0.1 localhost

在我的文件中这入口也是0.0.0.0 localhost:所以导致了这个问题,具体问什么会导致就不太清楚了

参考:http://stackoverflow.com/questions/16580370/mysql-error-2005-unknown-mysql-server-host-localhost11001

modify list of host names for your system:

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

Make sure that you have the following entry:

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)

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

localhost是host文件中代表127.0.0.1的一个名称, 如果在这个文件中去掉的话localhost就没有实际意义

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2013-12-10 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档