MySQL主机':: 1'或'127.0.0.1'不允许连接到该MySQL服务器 [英] MySQL Host '::1' or '127.0.0.1' is not allowed to connect to this MySQL server

查看:421
本文介绍了MySQL主机':: 1'或'127.0.0.1'不允许连接到该MySQL服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用MySQL 5.7.16的Web服务器(Windows Server 2012)上遇到一个奇怪的问题. 我无法再连接到mysql服务器,不知道为什么.

I have a strange issue on a web server (Windows Server 2012) with MySQL 5.7.16. I can't connect anymore to mysql server, I don't know why.

如果我键入mysql -uroot -ppassword出现错误

If I type mysql -uroot -ppassword appear an error

ERROR 1130 <HY000>: Host '::1' is not allowed to connect to this MySQL server or
ERROR 1130 <HY000>: Host '127.0.0.1' is not allowed to connect to this MySQL server

我尝试使用具有所有特权的另一个用户,并且我发现在主机中只有本地主机(不是127.0.0.1或:: 1)

I tried to use another user with all privileges and I've seen that in host there is only localhost (not 127.0.0.1 or ::1)

如何使用root @ localhost而不是root@127.0.0.1登录? 真令人沮丧... 每个尝试使用@ 127.0.0.1或@ :: 1的帐户,但主机中仅存在本地主机,我无法更改它.

How can I login with root@localhost and not with root@127.0.0.1? It's very frustrating... Every account trying to use @127.0.0.1 or @::1 but there exist only localhost in host and I can't change it.

如果我键入mysql -uroot -ppassword,我会看到
ERROR 1130 <HY000>: Host '127.0.0.1' is not allowed to connect to this MySQL server

If I type mysql -uroot -ppassword I see
ERROR 1130 <HY000>: Host '127.0.0.1' is not allowed to connect to this MySQL server

与我键入mysql -uroot -ppassword -h localhost或其他任何内容一样

Same if I type mysql -uroot -ppassword -h localhost or anything else

推荐答案

好,我已修复...

我已经在my.ini中评论了"skip_name_resolve",并且一切都恢复了工作..我真的不知道为什么,因为该记录也在昨天..上周..上个月..

I've comment "skip_name_resolve" in my.ini and everything is back to work.. i really don't know why because this record was in my.ini also yesterday..last week.. last month..

这篇关于MySQL主机':: 1'或'127.0.0.1'不允许连接到该MySQL服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆