MySQL------代码1024,can't get hostname for your address解决方法

Posted 玉天恒

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MySQL------代码1024,can't get hostname for your address解决方法相关的知识,希望对你有一定的参考价值。

1.hosts文件问题

进入C:\Windows\System32\drivers\etc\hosts
查看里面是否包含:
#   127.0.0.1     localhost
没有则添加,再重启mysql服务

2.重置sock

打开cmd.exe
输入tracert 127.0.0.1      //看能不能回调本机
成功后
输入netsh winsock reset
重启MySQL服务

 

以上是关于MySQL------代码1024,can't get hostname for your address解决方法的主要内容,如果未能解决你的问题,请参考以下文章

启动mysql遇到问题Can't connect to local MySQL server through socket '/tmp/mysql.sock' (示例代码

(转)ERROR 2002 (HY000): Can't connect to local MySQL server through socket '***' (示例代码(代码

ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061),mysql服务已启动(示例代码

Mysql -- BLOB, TEXT, GEOMETRY or JSON column 'result' can't have a default value

ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.33.10' (111) 解决方法

学习python3 MySQL数据库语法遇到的问题:"Can't connect to MySQL server on 'localhost'