欢迎来到站长天空!

其它服务器

当前位置: 主页 > 服务器 > 其它服务器

如何解决1130 - Host ‘172.17.0.1‘ is not allowed to connect to this MySQL server的问题

时间:2025-12-04 15:30:05|栏目:其它服务器|点击:

1、docker pull mysql 安装mysql

2、启动mysql容器:docker run --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 -d mysql

使用Navicat连接会报 1130 - Host '172.17.0.1' is not allowed to connect to this MySQL server 

按下面步骤修改:

6、连接mysql数据库:docker exec -it mysql bash

7、连接服务器: mysql -u root -p

8、看当前所有数据库:show databases ;   空格加分号

如何解决1130 - Host ‘172.17.0.1‘ is not allowed to connect to this MySQL server的问题

9、进入mysql数据库:use mysql ;

10、查看mysql数据库中所有的表:show tables ;

11、查看user表中的数据:select Host, User  from user ;

如何解决1130 - Host ‘172.17.0.1‘ is not allowed to connect to this MySQL server的问题

12、修改user表中的Host:  update user set Host='%' where User='root' ;

13、最后刷新一下:flush privileges ;

如何解决1130 - Host ‘172.17.0.1‘ is not allowed to connect to this MySQL server的问题

 Navicat连接成功

如何解决1130 - Host ‘172.17.0.1‘ is not allowed to connect to this MySQL server的问题

上一篇:Docker 容器全部停止的几种方法实现

栏    目:其它服务器

下一篇:nginx 常用指令 try_files allow root alias的使用

本文标题:如何解决1130 - Host ‘172.17.0.1‘ is not allowed to connect to this MySQL server的问题

本文地址:https://zz.feitang.co/server/28373.html

广告投放 | 联系我们 | 版权申明

申明:本站所有的文章、图片、评论等,均由网友发表或上传并维护或收集自网络,属个人行为,与本站立场无关。

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:257218569 | 邮箱:257218569@qq.com

Copyright © 2018-2026 站长天空 版权所有 Powered by EyouCms冀ICP备14023439号