使用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. MySQL高级知识(九)——慢查询日志

    前言:慢查询日志是MySQL提供的一种日志记录,它记录MySQL中响应时间超过阈值的语句,具体指运行时间超过long_query_time值的sql语句,该sql语句会被记录到慢查询日志中.慢查询日志 ...

  2. 【HNOI2018】毒瘤

    [HNOI2018]毒瘤 设\(f_{v,0}\)表示\(v\)的子树中\(v\)不选的方案数,\(f_{v,1}\)表示\(v\)选的方案数. 显然 \[ f_{v,0}=\prod (f_{sn, ...

  3. 安利一个_Java学习笔记总结

    javaIO 字符编码 多线程 线程池 ArrayList遍历方式 LinkedList遍历方式 Vector遍历方式 Vector, ArrayList, LinkedList 的区别是什么? Ha ...

  4. 通过JS如何获取IP地址

    通过JS获取你真实的外网IP和内网IP,就算开代理也没有用,想想真是太可怕了,还能不能愉快的装逼了! 代码: //get the IP addresses associated with an acc ...

  5. UVA1442-Cav(扫描法)

    Problem UVA1442-Cav Accept: 185  Submit: 679Time Limit: 3000 mSec Problem Description Input The inpu ...

  6. 转://SQLNET.EXPIRE_TIME参数

    DCD: Dead Connection Detection ,可以用于检测.标记僵死而没有断开会session,再由PMON进行清理,释放资源.开启DCD,只需要在服务端的sqlnet.ora文件中 ...

  7. PHP交互数据库

    教程 图形化界面访问自己的服务器上数据库 http://ip/phpmyadmin php文件 运行 <?php $servername = "localhost"; $us ...

  8. (二 -3-3) 天猫精灵接入Home Assistant-自动发现Mqtt设备-自动生成配置信息

    http://www.hassmart.com/products/switches/#tab=config switch: - platform: mqtt name: keting state_to ...

  9. git&github入门使用

    一.在Linux上安装Git 首先,你可以试着输入git,看看系统有没有安装Git,没有就yum一个,反正也是自己玩玩 二.版本库创建 什么是版本库呢?版本库又名仓库,英文名repository,你可 ...

  10. 【转】linux在shell中获取时间 date巧用

    echo `date +%Y-%m-%d" %H:%M:%S"` 获得当天的日期 date +%Y-%m-%d 输出: 2011-07-28 date1=$(date --date ...