【已解决】[图文步骤] message from server: “Host ‘172.17.0.1‘ is not allowed to connect to this MySQL server“

这篇具有很好参考价值的文章主要介绍了【已解决】[图文步骤] message from server: “Host ‘172.17.0.1‘ is not allowed to connect to this MySQL server“。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

写于 2024.03.07 北京.朝阳

@

目录
  • 报错信息
  • 环境现场
  • 解决方案
    • 步骤:
    • 成功
  • 最后

报错信息

先看看和你的报错一样不一样

null,  message from server: "Host '172.17.0.1' is not allowed to connect to this MySQL server"

【已解决】[图文步骤] message from server: “Host ‘172.17.0.1‘ is not allowed to connect to this MySQL server“


环境现场

mac 电脑使用 docker 部署了一个 mysql。

docker pull mysql:5.7

docker run -p 3306:3306 --name mysql-container -e MYSQL_ROOT_PASSWORD=123456  -d  mysql/mysql-server:5.7

查看是否启动成功。

docker ps

【已解决】[图文步骤] message from server: “Host ‘172.17.0.1‘ is not allowed to connect to this MySQL server“


解决方案

步骤:

  1. 查看 docker 信息
docker ps

【已解决】[图文步骤] message from server: “Host ‘172.17.0.1‘ is not allowed to connect to this MySQL server“

  1. 进入 docker 容器内部
docker exec -it  你的容器id bash

【已解决】[图文步骤] message from server: “Host ‘172.17.0.1‘ is not allowed to connect to this MySQL server“

  1. 连接数据库
mysql -u root -p

【已解决】[图文步骤] message from server: “Host ‘172.17.0.1‘ is not allowed to connect to this MySQL server“
4. 查询所有数据库

show databases ;

【已解决】[图文步骤] message from server: “Host ‘172.17.0.1‘ is not allowed to connect to this MySQL server“

  1. 进入mysql数据库:
use mysql ;

【已解决】[图文步骤] message from server: “Host ‘172.17.0.1‘ is not allowed to connect to this MySQL server“

  1. 查看mysql数据库中所有的表:
show tables ;

【已解决】[图文步骤] message from server: “Host ‘172.17.0.1‘ is not allowed to connect to this MySQL server“

  1. 查看user表中的数据:
select Host, User  from user ;

【已解决】[图文步骤] message from server: “Host ‘172.17.0.1‘ is not allowed to connect to this MySQL server“

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

【已解决】[图文步骤] message from server: “Host ‘172.17.0.1‘ is not allowed to connect to this MySQL server“

  1. 最后刷新一下:
flush privileges ;

【已解决】[图文步骤] message from server: “Host ‘172.17.0.1‘ is not allowed to connect to this MySQL server“

成功

【已解决】[图文步骤] message from server: “Host ‘172.17.0.1‘ is not allowed to connect to this MySQL server“


最后

大家在学习中一定遇到很多异常情况无从下手,可以加入讨论、观看行业内技术人员讨论解答。

https://github.com/Rodert文章来源地址https://www.toymoban.com/news/detail-837790.html

到了这里,关于【已解决】[图文步骤] message from server: “Host ‘172.17.0.1‘ is not allowed to connect to this MySQL server“的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • flink任务启动抛出mysql数据库连接过多异常message from server:“Too many connections“解决办法

    1. 异常现象 2. 现象分析 2.1 mysql数据库最大默认连接数是151 2.2 已用连接数超过了最大连接数导致的异常 3. 解决办法 3.1 修改mysql最大连接数配置文件 命令行修改最大连接数(max_connections),设置最大连接数为1000。 mysql set global max_connections = 1000; 这种方式有个问题,就是设置的最

    2024年02月14日
    浏览(37)
  • Data source rejected establishment of connection message from server:“Too many connections“; 数据库报错解决

    报错时的情况: 报错时我使用了微服务项目中使用Dubbo来进行管理, 然后同时启动了几个项目来进行数据库操作就会发生报错, 但是执行单个项目模块时是可以进行数据库操作的 ,具体报错信息忘记截图了, 可以看下面这个链接中的报错信息描述MYSQL Too many connections错误的解决办

    2024年02月06日
    浏览(36)
  • Host is not allowed to connect to this MySQL server解决方法

    这个错误,其实就是我们安装的MySQL不允许远程登录,解决方法如下: 1. 在装有MySQL的机器上登录MySQL mysql -u root -p密码,执行如下命令: 该结果表示是当前的root用户限制在当前的ip内访问的,需要修改他的访问域。 2. 执行命令: 3.执行 FLUSH PRIVILEGES 或者重启 MySQL 即可;

    2024年02月04日
    浏览(44)
  • Host is not allowed to connect to this MySQL server的解决办法

    首先我们在学习Java时,我们链接的MySql里面没有数据,我们也不知道有些什么数据,于是我们会有一种办法来继续进行我们代码的编写。 1.第一步是我的电脑必须要和我想使用的那个人的电脑处在同一个局域网下,例如学生在学校里面可以两台电脑同时连上学校的校园网;我

    2024年02月11日
    浏览(39)
  • 连接MySQL出现Host is not allowed to connect to this MySQL server 解决方法

    翻译: ‘不允许主机连接到此MySQL服务器’ (意思是本地账号连接可以登录,但是远程登陆不行 进入mysql 输入数据库密码 不知道密码可以去查 输入该命令行后看 root@localhost:后的内容就是密码 进入后依次输入下列命令行 最后退出mysql

    2024年02月16日
    浏览(33)
  • 解决1130-Host‘ ‘is not allowed to connect to this MySQL server,实现远程连接本地数据库

    在使用Navicat远程连接本地数据库时,遇到了这样一个问题, 我使用 本地主机的地址,连接本地的数据库,报错host ‘’ is not allowed to connect to this mysql server。 上网上查了一下资料,原来自己安装在本地的mysql默认时不允许进行远程登陆,如果想要远程访问本地的数据库需要修

    2024年02月11日
    浏览(37)
  • Sourcetree git 出现 The server‘s host key is not cached in the registry问题的解决办法

    省流: 参考博文:https://blog.csdn.net/sryan/article/details/50717528 Sourcetree会自带plink,用命令行切换到plink.exe所在路径,并执行plink git@github.com 命令,根据提示输入y 回车,问题就解决了。本质上是plink问玩家要y还是n,但是在Sourcetree的错误提示那里不能输入。 问题描述: 这几天用

    2024年02月03日
    浏览(30)
  • mysql - navicat连接数据库报错:1130 - Host *** is not allowed to connect to this MySQL server 解决(解决mysql报错问题

    使用navicat软件远程连接mysql时,软件提示弹框并且报错:1130 - Host x is not allowed to connect to this MySQL server,详细完美的解决方法, 很多教程都无法解决,本文可搞定。 其实,

    2024年02月19日
    浏览(46)
  • Host is not allowed to connect to this MySQL server

    问题:win10 系统上运行node,运行提示:Host is not allowed to connect to this MySQL server。 在windows10上面装完MySQL8.0.28,发现本地可以使用Navicat进行连接 ,但是在vue项目中调用node接口连接mysql却报错Host is not allowed to connect to this MySQL server 这个错误其实就是我们的MySQL不允许远程登录,所

    2024年02月13日
    浏览(36)
  • [Selenium]Message: disconnected: Unable to receive message from rendererXXX:报错解决

    selenium.common.exceptions.WebDriverException: Message: disconnected: Unable to receive message from renderer   (failed to check if window was closed: disconnected: not connected to DevTools)   (Session info: MicrosoftEdge=115.0.xxxx.xxx)         示例中使用的是最新版本的 webdriver.EdgeOptions() 创建 edge_options 实例。然后使用

    2024年02月04日
    浏览(30)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包