解决ERROR 1130: Host '192.168.11.1' is not allowed to connect to this MySQL
使用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的更多相关文章
- 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 ...
- 通过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 ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- 报错 "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 ...
- 错误代码是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 是无法给远程连接的用 ...
随机推荐
- JavaScript的基本包装类型概述与基本包装类型_Number类型
JavaScript的基本包装类型示例 为了便于操作基本类型值,javaScript 提供了 3 个特殊的引用类型:Boolean.Number和 String. 这些类型与其他引用类型相似,但同时也 ...
- MySQL高级知识(四)——Explain
前言:explain(执行计划),使用explain关键字可以模拟优化器执行sql查询语句,从而知道MySQL是如何处理sql语句.explain主要用于分析查询语句或表结构的性能瓶颈. 注:本系列随 ...
- linux下安装jdk_mysql_tomcat_redis
目前搬我以前的笔记,每个人做笔记方式都不一样,看别人的风格,生成自己的风格 1.linux安装软件和redis学习 jdk --- java开发运行环境 Tomcat - WEB程序的服务器 Mysq ...
- 如何征服面试官,拿到Offer [转]
转自 https://my.oschina.net/cccyb/blog/3012768 又到了茶余饭后的时间,想想写点什么,掐指一算,噢呦,快到3月份了,职场的金三银四跳槽季又来了,不同的是今年比往 ...
- VS CODE 快捷键
批量注释 alt + shift +a 单行注释 ctrl +/ 批量文本替换 ctrl +f2 https://www.cnblogs.com/shine-lee/p/10234378.html
- Python:Day54 ORM
Django项目中使用mysql DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'books', # ...
- java 常用
1.使用第三方PageHelper分页对象 Page<MallCashcouponUser> page = PageHelper.startPage(mallCashcouponUser. ...
- 五、Oracle 分组查询、视图
一.分组函数1.avg:平均分2.sum:求和3.max:最大值4.min:最小值注意:前面四个必须针对数值字段,且参数只能是一个5.count:求个数 二.分组查询1.语法是 group by 分组 ...
- oracle 11G direct path read 很美也很伤人
direct path read在11g中,全表扫描可能使用direct path read方式,绕过buffer cache,这样的全表扫描就是物理读了. 在10g中,都是通过gc buffer来读 ...
- Android APP性能测试笔记(一)
Android APP性能测试笔记(一) (1)工具使用 Android Studio GT, root的真机 (2)记录apk大小(对比竞品) 使用Android Studio导入需要测试 ...