mysql远程连接 Host * is not allowed to connect to this MySQL server
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的更多相关文章
- 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 ...
- 转:mysql远程连接 Host * is not allowed to connect to this MySQL server
在本机登入mysql后,更改"mysql"数据库里的"user"表里的"host"项,从"localhost"改为'%' ...
- 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 ...
- 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 ...
- ***远程连接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 ...
- mysql不能链接远程,报(Host '***.***.***.***' is not allowed to connect to this MySQL server)
Host '***.***.***.***' is not allowed to connect to this MySQL server 其中***...是本机公网ip; 解决办法: 首先看报错窗口 ...
- ERROR 1130: Host ’...′ is not allowed to connect to this MySQL server
/******************************************************************** * ERROR 1130: Host ’...′ is no ...
- ERROR 1130: Host is not allowed to connect to this MySQL server
解决远程连接mysql错误1130代码的方法 今天在用远程连接Mysql服务器的数据库,不管怎么弄都是连接不到,错误代码是1130,ERROR 1130: Host 192.168.2.159 is ...
- ‘Host’ is not allowed to connect to this mysql server
‘Host’ is not allowed to connect to this mysql server mysql 数据库不允许远程连接 方法一:修改 host 表 进入mysql数据库,选择m ...
随机推荐
- Dynamics 365-部分用户访问环境缓慢
链接来自MS MVP 罗勇大神的Dynamics 365中部分账号使用系统明显缓慢怎么办?先这么干! 之前项目中也遇到过客户部分账户访问环境缓慢的问题,在此做个记录,等再碰到了,以此思路进行尝试
- mysql随笔系列-1
MySQL数据库管理 本人实验所用的MySQL数据库版本:5.5.56-MariaDB MariaDB Server 操作系统:centos7.5 1.创建数据库 MariaDB [(none)]& ...
- mysql学习之完整的select语句
本文内容: 完整语法 去重选项 字段别名 数据源 where group by having order by limit 首发日期:2018-04-11 完整语法: 先给一下完整的语法,后面将逐一来 ...
- AIOps 平台的误解,挑战及建议(中)— AIOps常见的误解
本文篇幅较长,分为上,中,下,三个部分进行连载.内容分别为:AIOps 背景/所应具备技术能力分析(上),AIOps 常见的误解(中),挑战及建议(下). 前言 我大概是 5,6 年前开始接触 ITO ...
- QQ空间、新浪微博、腾讯微博等一键分享API链接代码
1.新浪微博:http://service.weibo.com/share/share.php?url= count=表示是否显示当前页面被分享数量(1显示)(可选,允许为空)&url=将页面 ...
- Docker 入门到实践(四)Docker 使用镜像
一.获取镜像 Docker Hub 上有大量的高质量的镜像让我们获取,命令为: docker pull [选项] [Docker Registry 地址[:端口号]/]仓库名[:标签] 具体的选项可以 ...
- 第六章 第一个Linux驱动程序: 统计单词个数
一.编写Linux驱动程序的步骤 第1 步:建立Linux 驱动骨架(装载和卸载Linux 驱动) 骨架部分主要是Linux驱动的初始化和退出函数,代码如下: #include <linux/m ...
- mybatis : ERROR. token : COMMA, pos : 373
查询的字段符号问题,可能是多了" , " 也可能是少了 " , " 仔细检查, 都能解决
- ORM版学员管理系统3
老师信息管理 思考 三种方式创建多对多外键方式及其优缺点. 通过外键创建 class Class(models.Model): id = models.AutoField(primary_key=Tr ...
- Python的datetime模块分析
datetime模块用于是date和time模块的合集,datetime有两个常量,MAXYEAR和MINYEAR,分别是9999和1. datetime模块定义了5个类,分别是 1.datetime ...