有时候telnet一个mysql服务器的时候会出现:

Host '192.168.0.1' is not allowed to connect to this MySQL serverConnection closed by foreign host.

如图:

这个原因是因为索要链接的mysql数据库只允许其所在的服务器连接,需要在mysql服务器上设置一下允许的ip权限,如下:

连接命令端:

1.连接mysql

mysql -u root -p

如图:

2.授权

grant all privileges on *.* to 'root'@'192.168.0.1' identified by '123456';

如图:

当然,如果想给所有ip都赋予权限,则这样:

grant all privileges on *.* to 'root'@'%' identified by '123456';

3.使授权立即生效

flush privileges;

如图:

然后再远程telnet或者连接这个mysql数据库就可以成功了。

参考

https://blog.csdn.net/dongdong9223/article/details/77854690

telnet mysql时出现:is not allowed to connect to this MySQL serverConnection closed by foreign host问题的解决的更多相关文章

  1. mysql时出现:is not allowed to connect to this MySQL serverConnection closed by foreign host问题的解决

    这个原因是因为索要链接的mysql数据库只允许其所在的服务器连接,需要在mysql服务器上设置一下允许的ip权限,如下: 1.连接mysql mysql -u root -p 1 如图: 2.授权 g ...

  2. 连接远程数据库时出现 SSH: expected key exchange group packet from server / 2003 - Can't connect to MySQL server on 'XXX' (10038) / 1130 - Host 'XXX' is not allowed to connect to this MySQL server

    昨天在自己的远程服务器上玩,把系统重装了.新装了MySQL,在本地用navicat连接的时候出了几个小问题. 问题一:SSH: expected key exchange group packet f ...

  3. 远程连接mysql报错【1130 -host 'localhost' is not allowed to connect to this mysql server】

    远程连接mysql时包如下错误: 1130 -host 'localhost' is not allowed to connect to this mysql server 解决办法 本地用root账 ...

  4. 解决服务器连接错误Host ‘XXX’ is not allowed to connect to this MySQL server

    这段时间在研究火车头的入库教程,在“配置登陆信息和数据库(mysql)”连接中,出现“服务器连接错误Host 'XXX' is not allowed to connect to this MySQL ...

  5. ERROR 1130: Host is not allowed to connect to this MySQL server

    解决远程连接mysql错误1130代码的方法 今天在用远程连接Mysql服务器的数据库,不管怎么弄都是连接不到,错误代码是1130,ERROR 1130: Host 192.168.2.159 is ...

  6. mysql不能链接远程,报(Host '***.***.***.***' is not allowed to connect to this MySQL server)

    Host '***.***.***.***' is not allowed to connect to this MySQL server 其中***...是本机公网ip; 解决办法: 首先看报错窗口 ...

  7. 新部署的linux web服务器error Host ‘*.*.*.*’ is not allowed to connect to this MySQL server

    最近上头交给我个任务,把WINDOWS平台下开发的网站,部署在LINUX环境上. 把mysql安装好了,所有表单都导入没问题,然后代码都放在tomcat下的webapps文件夹下了,主页 面可以正常显 ...

  8. mysql error 1130 hy000:Host 'localhost' is not allowed to connect to this mysql server 解决方案

    ERROR 1130 (HY000): Host 'localhost' is not allowed to connect to this MySQL server D:\Wamp\mysql-\b ...

  9. Mysql数据库连接报错!1130:host XXX is not allowed to connect to this mysql server

    我猜想是可能是连接的用户权限问题.结果这样子操作mysql库,可以解决此问题.在本机登入mysql后,更改 “mysql” 数据库里的 “user” 表里的 “host” 项,从”localhost” ...

随机推荐

  1. Python复习笔记(五)面向对象

    1. __init__方法 # 1. 为对象在内存 中分配空间 -- 创建对象 # 2. 为对象属性 设置初始值 -- 初始化方法(init)+-------------- # 3. __init__ ...

  2. Spark源码剖析 - SparkContext的初始化(九)_启动测量系统MetricsSystem

    9. 启动测量系统MetricsSystem MetricsSystem使用codahale提供的第三方测量仓库Metrics.MetricsSystem中有三个概念: Instance:指定了谁在使 ...

  3. HanLP中人名识别分析

    HanLP中人名识别分析 在看源码之前,先看几遍论文<基于角色标注的中国人名自动识别研究> 关于命名识别的一些问题,可参考下列一些issue: 名字识别的问题 #387 机构名识别错误 关 ...

  4. Image转Base64

    今天和一个朋友联调图片转Base64时发现一个问题 public static string ImageToBase64(Image img) { BinaryFormatter binFormatt ...

  5. 完美解决idea继承maven后,构建项目慢的问题

    1.修改远程仓库的位置(maven默认仓库是国外,所以我们下载jar包很慢) 找到我们安装的maven路径下的conf文件夹下的settings.xml文件 将文件复制到 C:\Users\Admin ...

  6. 【C++】reference parameter-引用参数

    1.reference parameter 以下两个函数等效,只调用方式不同: 1> 1 int reset(int i){ 2 i = 13; 3 return i; 4 } 5 6 int ...

  7. Listener 快速开始

    [SessionListener] @WebListenerpublic class SessionListener implements HttpSessionListener,HttpSessio ...

  8. 3D图像算法

    http://dev.gameres.com/Program/Visual/3D/3Darit.htm 3D简介 我们首先从坐标系统开始.你也许知道在2D里我们经常使用Ren?笛卡儿坐标系统在平面上来 ...

  9. 最小生成树入门(克鲁斯卡尔+普利姆 hdu1233)

    克鲁斯卡尔 #include <set> #include <map> #include <queue> #include <stack> #inclu ...

  10. Flume配置Replicating Channel Selector

    1 官网内容 上面的配置是r1获取到的内容会同时复制到c1 c2 c3 三个channel里面 2 详细配置信息 # Name the components on this agent a1.sour ...