300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > Host is not allowed to connect to this MySQL server错误的解决办法

Host is not allowed to connect to this MySQL server错误的解决办法

时间:2022-04-30 07:05:54

相关推荐

Host is not allowed to connect to this MySQL server错误的解决办法

错误描述

我先做了这些工作:服务器用的 Windows Server 。配置好服务器上的MySQL。防火墙允许mysqld.exe 。

然后在我自己的电脑上用 workbench 连接服务器上的 MySQL 发现无法连接。提示错误: Host ‘xxx.xxx.xxx.xxx’ is not allowed to connect to this MySQL server 。其中 ‘xxx.xxx.xxx.xxx’ 是我自己的电脑的IP。

解决方法

远程桌面连接到服务器。调用mysql -u root -p命令打开客户端,连接数据库。执行如下命令并得到返回结果:

mysql> use mysqlmysql> select t.host from user t where t.user='root';+--------------+| host |+--------------+| localhost |+--------------+

这个返回结果说明现在 root 用户只允许在服务器的本地登录。

执行如下命令:

好啦!!!!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。