mysql error 2005 - Unknown MySQL server host 'localhost'(11001)
有的时候偶尔会出现这个问题 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:所以导致了这个问题,具体问什么会导致就不太清楚了
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就没有实际意义
如果喜欢作者的文章,请关注"写代码的猿"订阅号以便第一时间获得最新内容。本文版权归作者所有,欢迎转载.
mysql error 2005 - Unknown MySQL server host 'localhost'(11001)的更多相关文章
- 关于MySQL错误 2005 - Unknown MySQL server host 'localhost' (0) 原因及解决方法
今天在外面开navicat for mysql的时候,怎么也连不上自己本机上的数据库,一直显示2005 - Unknown MySQL server host 'localhost' (0): 错误代 ...
- Navicat for MySQL打开链接时出错错误为:2005 - Unknown MySQL server host 'localhost'(0)?
问题:Navicat for MySQL打开链接时出错错误为:2005 - Unknown MySQL server host 'localhost'(0)? 在使用navicat 连接mysql数据 ...
- Error-MySQL:2005 - Unknown MySQL server host 'localhost'(0)
ylbtech-Error-MySQL:2005 - Unknown MySQL server host 'localhost'(0) 1.返回顶部 1. 今天在外面开navicat for mysq ...
- navicat报错2005 - Unknown MySQL server host 'localhost' (0) 原因及解决方法
报错原因:没有连接互联网,用navicat连接本地mysql数据库,连接属性ip为localhost. 解决办法:将ip改为127.0.0.1即可.localhost是需要DNS解析后才会是127.0 ...
- MySQL ERROR 2005 (HY000)
问题 使用 docker run -it --rm mysql mysql -h 192.168.18.133:3306 -uroot -p 连接远程mysql服务器时,ERROR 2005 (HY0 ...
- mysql出现Can't connect to MySQL server on 'localhost' (10061)的解决方法
网上搜索的一: 今天把mysql数据库拷贝到另外一台机上,结果连不上,报“Can't connect to MySQL server on 'localhost' (10061)“错误 到网上sear ...
- 连接mysql时报:message from server: "Host '192.168.76.89' is not allowed to connect to this MySQL server 处理方案
1.先用localhost方式连接到MySQL数据库,然后使用MySQL自带的数据库mysql; use mysql: 2.执行:select host from user where user = ...
- 连接mysql时报:message from server: "Host '192.168.76.89' is not allowed to connect to this MySQL server
处理方案: 1.先用localhost方式连接到MySQL数据库,然后使用MySQL自带的数据库mysql; use mysql: 2.执行:select host from user where u ...
- MYSQL Error 2006HY000:MySQL server has gone away的解决方案
MySQL server has gone away有几种情况. 1.应用程序(比如PHP)长时间的执行批量的MYSQL语句. 最常见的就是采集或者新旧数据转化. 解决方案: 在my.cnf文件中添加 ...
随机推荐
- SpringCloud实战7-Config分布式配置管理
分布式环境下的统一配置框架,已经有不少了,比如百度的disconf,阿里的diamand 官方文档对spring Cloud Config的描述如下:: Spring Cloud Config为分布式 ...
- linux安装tomcat Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
这两天我们的开发机重启了好几次,发现每次重启后我的tomcat总是没有启动.检查java路径,配置正确,后来拿普通账号启动tomcat时报如下的错: Neither the JAVA_HOME nor ...
- Java的参数传递是「值传递」还是「引用传递」?
关于Java传参时是引用传递还是值传递,一直是一个讨论比较多的话题. 有人说Java中只有值传递,也有人说值传递和引用传递都是存在的,比较容易让人产生疑问. 关于值传递和引用传递其实需要分情况看待. ...
- dirlock_windows.go
package dirlock type DirLock struct { dir string } func New(dir string) *DirLock { return &a ...
- bzoj 3505 [Cqoi2014]数三角形 组合
ans=所有的三点排列-共行的-共列的-斜着一条线的 斜着的枚举每个点和原点的gcd,反过来也可以,还能左右,上下挪 #include<cstdio> #include<cstrin ...
- 张高兴的 Windows 10 IoT 开发笔记:串口红外编解码模块 YS-IRTM
This is a Windows 10 IoT Core project on the Raspberry Pi 2/3, coded by C#. GitHub: https://github.c ...
- 前端学习笔记之CSS选择器
阅读目录 一 基本选择器 二 后代选择器.子元素选择器 三 兄弟选择器 四 交集选择器与并集选择器 五 序列选择器 六 属性选择器 七 伪类选择器 八 伪元素选择器 九 CSS三大特性 一 基本选择器 ...
- Mybatis配置详解
一.SqlSession的使用范围说明 1.SQLSessionFactoryBuilder 通过SqlSessionFactoryBuilder创建会话工厂SqlSessionFactory, ...
- 越来越火的"中台"是什么
很多企业都将促进业务与科技的深度融合作为发展战略,也都想学学阿里的中台战略,其实,除了中台战略之外,基于企业级业务架构设计来实现组件化开发也是企业数字化转型的优选路径,是弥合业务与技术之间“数字鸿沟” ...
- Spark学习之编程进阶总结(一)
一.简介 这次介绍前面没有提及的 Spark 编程的各种进阶特性,会介绍两种类型的共享变量:累加器(accumulator)与广播变量(broadcast variable).累加器用来对信息进行聚合 ...