1、先用localhost方式连接到MySQL数据库,然后使用MySQL自带的数据库mysql;

use mysql;

2、执行:select host from user where user = 'root';  发现,host的值就是localhost。

所以将它的值改掉:update user set host='%' where user = 'root';

3、修改完成后,执行:flush privileges;

将修改内容生效,再次配置时,用IP地址或者localhost 就都能正常连接到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> select host from user where user = 'root';

+-----------+

| host      |

+-----------+

| localhost |

+-----------+

1 row in set (0.00 sec)

mysql> update user set host='%' where user = 'root';

Query OK, 1 row affected (0.00 sec)

Rows matched: 1  Changed: 1  Warnings: 0

mysql> select host from user where user = 'root';

+------+

| host |

+------+

| %    |

+------+

1 row in set (0.00 sec)

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

mysql>

连接mysql时报:message from server: "Host '192.168.76.89' is not allowed to connect to this MySQL server 处理方案的更多相关文章

  1. 连接mysql时报:message from server: "Host '192.168.76.89' is not allowed to connect to this MySQL server

    处理方案: 1.先用localhost方式连接到MySQL数据库,然后使用MySQL自带的数据库mysql; use mysql: 2.执行:select host from user where u ...

  2. java.sql.SQLException: null, message from server: "Host '192.168.xxx.xxx' is not allowed to connect to this MySQL server"

    当你连接自己的电脑上的MySQL时,报这样的错,你可以把ip换成 127.0.0.1或者localhost  ,当然前提是用户名和密码正确

  3. java.sql.SQLException: null, message from server: "Host '192.168.126.100' is not allowed to connect to this MySQL server"

  4. hive报错java.sql.SQLException: null, message from server: "Host '192.168.126.100' is not allowed to connect to this MySQL server"

  5. 报错 "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 ...

  6. 通过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 ...

  7. 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 ...

  8. 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 ...

  9. 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     ...

随机推荐

  1. 解决css的float父div没有高度

    在做页面设计常会碰到css的float父div没有高度的情况,HTML代码设计 <div class='box'> <div class='float_left'></d ...

  2. Python- and & or 的短路原则

    条件1 and 条件2 条件1 or 条件2 短路原则 对于and 如果前面的第一个条件为假,那么这个and前后两个条件组成的表达式的计算结果就一定为假,第二个条件就不会被计算 对于or 如果前面的第 ...

  3. ES提高数据压缩的设置——单字段,去掉source和all

    curl -XPUT 'http://localhost:9200/hec_test3' -d ' { "mappings": { "hec_type3": { ...

  4. QWidget上下文菜单处理函数

    QWidget类是Qt中所有可视化部件的基类,其很多函数都是虚函数,能被子类重写以表现不同形式和功能,今天来学习一下QWdiget的事件处理函数. 事件是鼠标.键盘或系统因其自身某些状态发生改变而引起 ...

  5. Java如何调用dll

    -----------------------------前置条件------------------------------------- 1. 首先有testdll.dll 2. 需要testdl ...

  6. 洛谷 P4525 & P4526 [模板] 自适应辛普森积分

    题目:https://www.luogu.org/problemnew/show/P4525 https://www.luogu.org/problemnew/show/P4526 学习辛普森积分:h ...

  7. windows7下c++11环境搭建

    1.安装codeblocks 13.12 2.下载安装tdm-gcc-4.8.1-3 3.配置coldblocks的编译器(settings->compiler->compiler set ...

  8. virtual judge(专题一 简单搜索 A)

    问题描述: Description 在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别.要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘, ...

  9. ES6学习之字符串的扩展

    字符的Unicode表示法 \uxxxx可以表示一个双字节的字符(xxxx表示字符编码,范围在0000---FFFF),超出此范围用两个双字节表示. console.log("\u0061& ...

  10. jdbc 新认识

    以前一直用jdbc,没有深入看看,原来jdbc是java自己的接口规范,db厂商按照接口进行开发对应的驱动,jdbc可以获取db中的元信息,执行sql,获取结果,操作db等等.示例如下. public ...