使用navicat进行远程登录MySQL时,报出

ERROR 1130: Host '192.168.11.1' is not allowed to connect to this MySQL  server

解决方法:需要修改mysql数据库下的user表user=root的host字段的值,将localhost改为%

首先在mysql安装机器上登录mysql,

>>提君博客原创  http://www.cnblogs.com/tijun/  <<

然后切换到mysql 数据库下

提君博客原创

mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A Database changed

可以看一下此库下都有那些数据库表

mysql> show tables
-> ;
+---------------------------+
| Tables_in_mysql |
+---------------------------+
| columns_priv |
| db |
| event |
| func |
| general_log |
| help_category |
| help_keyword |
| help_relation |
| help_topic |
| host |
| ndb_binlog_index |
| plugin |
| proc |
| procs_priv |
| servers |
| slow_log |
| tables_priv |
| time_zone |
| time_zone_leap_second |
| time_zone_name |
| time_zone_transition |
| time_zone_transition_type |
| user |
+---------------------------+
rows in set (0.00 sec)

查看user表中的内容

mysql> select host,user from user;
+------------+------+
| host | user |
+------------+------+
| 127.0.0.1 | root |
| localhost | |
| localhost | root |
| ltt5.bg.cn | |
| ltt5.bg.cn | root |
+------------+------+
rows in set (0.00 sec)

这里就可以看到,root用户目前只允许在localhost下登录

提君博客原创

修改

mysql> update user set host = '%' where user = 'root';
ERROR (): Duplicate entry '%-root' for key 'PRIMARY'
mysql> flush privileges;
Query OK, rows affected (0.00 sec)

中间会报出一个ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY'

不用管,执行flush privileges;即可

再次查询user表

mysql> select host,user from user;
+------------+------+
| host | user |
+------------+------+
| % | root |
| 127.0.0.1 | root |
| localhost | |
| ltt5.bg.cn | |
| ltt5.bg.cn | root |
+------------+------+
rows in set (0.00 sec)

到这里,你可以在navicat上再次连接mysql,就可以成功了。

提君博客原创

>>提君博客原创  http://www.cnblogs.com/tijun/  <<

 

解决ERROR 1130: Host '192.168.11.1' is not allowed to connect to this MySQL的更多相关文章

  1. SQL Error (1130): Host '192.168.1.126' is not allowed to connect to this MySQL server

    通过HeidiSQL连接MYSQL数据库报错: SQL Error (1130): Host '192.168.1.126' is not allowed to connect to this MyS ...

  2. 通过navicat连接mysql服务器提示SQL Error (1130): Host '192.168.1.100' is not allowed to connect to this MySQL server

    新装一个mysql,尝试用通过navicat连接mysql服务器的时候提示: SQL Error (1130): Host '192.168.1.100' is not allowed to conn ...

  3. Mysql远程连接报错:SQL Error (1130): Host '192.168.61.128' is not allowed to connect to this MySQL server

    Mysql远程连接报错:SQL Error (1130): Host '192.168.0.18' is not allowed to connect to this MySQL server     ...

  4. Mysql远程连接报错:SQL Error (1130): Host '192.168.6.128' is not allowed to connect to this MySQL server

    通过SQLyog连接linux中的MySQL报错问题:SQL Error (1130): Host '192.168.6.128' is not allowed to connect to this ...

  5. ERROR 1130: Host '192.168.1.3' is not allowed to connect to this MySQL ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY'

    use mysql mysql> select host, user from user; 将相应用户数据表中的host字段改成'%': update user set host='%' whe ...

  6. ERROR 1130 (HY000): Host '192.168.20.165' is not allowed to connect to this MySQL server

    问题 远程连接mysql时遇到如下问题: ERROR 1130 (HY000): Host '192.168.20.165' is not allowed to connect to this MyS ...

  7. MYSQL错误1130:ERROR 1130: Host 10.10.36.115 is not allowed to connect to this MySQL server

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

  8. 报错 "Host '192.168.209.1' is not allowed to connect to this MySQL server"

    版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明.本文链接:https://blog.csdn.net/weixin_37632381/artic ...

  9. 错误代码是1130,ERROR 1130: Host xxx.xxx.xxx.xxx is not allowed to connect to this MySQL server 是无法给远程连接的用户权限问题

    错误代码是1130,ERROR 1130: Host xxx.xxx.xxx.xxx is not allowed to connect to this MySQL server 是无法给远程连接的用 ...

随机推荐

  1. 数据库的未来:ORM+LINQ+RX

    数据库的未来:ORM+LINQ+RX 数据        操作         异步 ORM       LINQ        RX

  2. centos7下如何隐藏nginx的版本号

    我们在访问nginx的时候会暴露nginx的版本号,如何将这些版本号隐藏呢? 其实隐藏版本号非常简单 在nginx的配置文件中添加一个server——tokens  off:参数就可以了,下面进行操作 ...

  3. Spring配置中的"classpath:"与"classpath*:"的区别研究(转)

    Spring配置中的"classpath:"与"classpath*:"的区别研究(转)   概念解释及使用场景: classpath是指WEB-INF文件夹下 ...

  4. python3 迭代器

    ''' 迭代:重复的过程,并且每次迭代的结果都是下次迭代的初始值 可迭代的 Iterable 迭代器 Iterator iter(数据) == 数据.__iter__() 将数据转换为迭代器 next ...

  5. 用return关键字实现求和操作

    package com.Summer_0419.cn; /** * @author Summer * 用return关键字的知识,实现求和操作 */ public class Test_Method0 ...

  6. Python脱产8期 Day11 2019/4/25

    一 字符串比较 1.字符串比较:字符串对应的ascii进行比较 2.多个字符的字符串进行比较:从前往后逐个字符进行比较,一旦哪个位置的字符出现了大小关系就结束比较. 二 形参与实参 1.参数介绍: 函 ...

  7. Java多线程(二)——常用的实现多线程的两种方式

    一.继承Thread类创建线程类 Java使用Thread类代表线程,所有的线程对象都必须是Thread类或其子类的实例.每个线程的作用是完成一定的任务,实际上就是执行一段程序流即一段顺序执行的代码. ...

  8. BZOJ4361 isn 树状数组、DP、容斥

    传送门 不考虑成为非降序列后停止的限制,那么答案显然是\(\sum\limits_{i=1}^N cnt_i \times (N-i)!\),其中\(cnt_i\)表示长度为\(i\)的非降序列数量 ...

  9. devops工具-Ansible进阶playbook&roles

    一.playbook介绍     playbook 是 Ansible 管理配置.部署应用的核心所在,一个playbook由有多“play组成”,而一个play实际就是一个task,每个task是由多 ...

  10. Docker存储卷(V18.X)

    简介 介绍 Docker的存储卷称之为volume,本质上容器上的一个或者多个目录,而这些目录绕过了联合文件系统,与宿主机中的目录或者其他容器目录进行了绑定关系,这种绑定关系可以看作Linux的mou ...