有时候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. string类型用法大全

    使用标准C++中string类,要包含头文件< string > string类的构造函数 //string(const char *s); 用字符串s初始化 string s1(&quo ...

  2. ASP.NET MVC 4 (十) 模型验证

    模型验证是在模型绑定时检查从HTTP请求接收的数据是否合规以保证数据的有效性,在收到无效数据时给出提示帮助用户纠正错误的数据. 显式模型验证 验证数据最直接的方式就是在action方法中对接收的数据验 ...

  3. 归并排序_JAVA

    import java.util.Arrays; public class Main { public static void main(String[] args) { int[] a = { 6, ...

  4. [Android] Android ViewPager 中加载 Fragment的两种方式 方式(一)

    Android ViewPager 中加载 Fragmenet的两种方式 一.当fragment里面的内容较少时,直接 使用fragment xml布局文件填充 文件总数 布局文件:view_one. ...

  5. 二十二、Linux 进程与信号---进程创建(续)

    22.2 父子进程操作文件 文件操作由两种模式: IO 系统调用操作文件 标准C IO 操作文件 看代码: #include <unistd.h> #include <string. ...

  6. [译]Nuget.Server

    原文 NuGet.Server是一个包,可用于使一个ASP.NET应用host一个package feed . 使用VS创建一个新的空WEB应用,添加Nuget.Server包. 配置应用的Packa ...

  7. 常用SQL语句大全总结

    出处:http://www.cnblogs.com/0351jiazhuang/p/4530366.html SQL是(Structured Query Language)结构化查询语言的简称,下面赵 ...

  8. [C++]PAT乙级1009. 说反话 (17/20)

    /* 1009. 说反话 (20) 给定一句英语,要求你编写程序,将句中所有单词的顺序颠倒输出. 输入格式: 测试输入包含一个测试用例, 在一行内给出总长度不超过80的字符串. 字符串由若干单词和若干 ...

  9. linux随机生成密码

    1.mkpassword工具 # 使用最多的密码生成工具 yum -y install expect #需要安装expect工具 mkpasswd -l -d -c -C -s #直接在命令行进行随机 ...

  10. 【译】第三篇 SQL Server安全主体和安全对象

    本篇文章是SQL Server安全系列的第三篇,详细内容请参考原文. 一般来说,你通过给主体分配对象的权限来实现SQL Server上的用户与对象的安全.在这一系列,你会学习在SQL Server实例 ...