mysql -u root -p

mysql>use mysql;

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

mysql>flush privileges;

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> update user set password=password('root123') where user='root' and host='localhost'

-> ;

Query OK, 1 row affected (0.00 sec)

Rows matched: 1  Changed: 1  Warnings: 0

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

-> ;

+------+

| host |

+------+

| host |

| host |

| host |

| host |

+------+

4 rows in set (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON *.* TO ‘root’@‘%’ IDENTIFIED BY ‘root123’ WITH GRANT OPTION;

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%’ IDENTIFIED BY ‘root123’ WITH GRANT OPTION' at line 1

mysql> grant all privileges on *.* to 'root'@'%' identified by 'root123' with grant option;

Query OK, 0 rows affected (0.00 sec)

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

-> flush privileges;

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'flush privileges' at line 2

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

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

-> ;

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

| host                  |

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

| %                     |

| 127.0.0.1             |

| ::1                   |

| localhost             |

| localhost.localdomain |

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

5 rows in set (0.00 sec)

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

ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY'

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

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

-> ;

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

| host                  | user |

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

| %                     | root |

| 127.0.0.1             | root |

| ::1                   | root |

| localhost             | root |

| localhost.localdomain | root |

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

5 rows in set (0.00 sec)

mysql>

mysql远程连接 Host * is not allowed to connect to this MySQL server的更多相关文章

  1. mysql远程连接 Host * is not allowed to connect to this MySQL server(第一次配置好lnmp环境)

    1.第一次在linux上搭建好mysql,本机windows远程链接报错Host * is not allowed to connect to this MySQL server 2.原因:mysql ...

  2. 转:mysql远程连接 Host * is not allowed to connect to this MySQL server

    在本机登入mysql后,更改"mysql"数据库里的"user"表里的"host"项,从"localhost"改为'%' ...

  3. mySql 远程连接(is not allowed to connect to this MySQL server)

    如果你想连接你的mysql的时候发生这个错误: ERROR 1130: Host '192.168.1.3' is not allowed to connect to this MySQL serve ...

  4. MYSQL ERROR 1130: Host is not allowed to connect to this MySQL server

    今天安装MYSQL遇到MYSQL ERROR 1130: Host is not allowed to connect to this MySQL server, 试了很多办法都不行 skip-gra ...

  5. ***远程连接MYSQL提示1130 - Host is not allowed to connect to this MySQL server

    如果你想连接你的mysql的时候发生这个错误: ERROR 1130: Host '192.168.1.3' is not allowed to connect to this MySQL serve ...

  6. mysql不能链接远程,报(Host '***.***.***.***' is not allowed to connect to this MySQL server)

    Host '***.***.***.***' is not allowed to connect to this MySQL server 其中***...是本机公网ip; 解决办法: 首先看报错窗口 ...

  7. ERROR 1130: Host ’...′ is not allowed to connect to this MySQL server

    /******************************************************************** * ERROR 1130: Host ’...′ is no ...

  8. ERROR 1130: Host is not allowed to connect to this MySQL server

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

  9. ‘Host’ is not allowed to connect to this mysql server

    ‘Host’ is not allowed to  connect to this mysql server mysql 数据库不允许远程连接 方法一:修改 host 表 进入mysql数据库,选择m ...

随机推荐

  1. 2018-08-06 在Office的VBA代码里中文命名

    在Excel处理数据时, 顺便试了一下VBA代码编辑器里输入中文, 结果显示为乱码. 查了一下发现VBA本身支持Unicode, 但需要设置系统配置使编辑器能够正常显示, 即设置简体中文为Curren ...

  2. Android项目实战(四十三):夜神模拟器

    一.下载模拟器到电脑 夜神模拟器 二.环境配置 计算机--系统--高级系统设置--环境变量 PATH 里面加入夜神模拟器的安装目录下的bin文件 三.启动模拟器 四.运行cmd命令,cd到夜神安装目录 ...

  3. Spinner的简单使用

    <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android=&quo ...

  4. 【redis专题(9)】事务

    Redis支持简单的事务,所谓简单是因为其不支持回滚(回滚是用队列模仿的),与mysql有以下区别 rollback与discard的区别: 如果已经成功执行了2条语句, 第3条语句出错 Rollba ...

  5. [20180926]神奇的规避ORA-01795方法.txt

    [20180926]神奇的规避ORA-01795方法.txt --//大家知道in里面的值限制1000个值,如果超出报ORA-01795错误. D:\> ooerr 0179501795, 00 ...

  6. selenium驱动程序下载和使用流程

    转自https://blog.csdn.net/weixin_42660771/article/details/81286982 1.下载地址    https://github.com/mozill ...

  7. 线程--实现Runnable接口

    实现Runnable接口,创建线程步骤: 1.定义类,并实现Runnable接口 2.重写Runnable接口中的run()方法 3.通过Thread类建立线程对象 4.将实现了Runnable接口的 ...

  8. KFCM算法的matlab程序

    KFCM算法的matlab程序 在“聚类——KFCM”这篇文章中已经介绍了KFCM算法,现在用matlab程序对iris数据库进行简单的实现,并求其准确度. 作者:凯鲁嘎吉 - 博客园 http:// ...

  9. Node爬虫之初体验

    记得之前就听说过爬虫,个人初步理解就是从网页中抓取一些有用的数据,存储到本地,今天就当是小牛试刀,拿来溜溜...... 实现需求: 抓取课程数据,输入url后并在浏览器端以一定的数据格式显示出来(如下 ...

  10. Why do Kafka consumers connect to zookeeper, and producers get metadata from brokers?

    Why do Kafka consumers connect to zookeeper, and producers get metadata from brokers? Ask Question u ...