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

1.hosts文件问题

进入C:WindowsSystem32driversetchosts
查看里面是否包含:
#   127.0.0.1     localhost
没有则添加,再重启MySQL服务

2.重置sock

打开cmd.exe
输入tracert 127.0.0.1      //看能不能回调本机
成功后
输入netsh winsock reset
重启MySQL服务
原文地址:https://www.cnblogs.com/tianhengblogs/p/6504683.html