当前位置:首页 - MySql

连接mysql时提示 is not allowed to connect to this mysql

作者:高景洋 日期:2022-12-13 14:44:33 浏览次数:648

3306端口已开放,已配置mysql远程链接,但是提示 “is not allowed to connect to this mysql”,要怎么处理?

操作步骤如下:

1、终端连接mysql

2、执行以下 sql :

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


3、检查查询结果是否为 : localhost

4、如果是,则再执行以下 sql:

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

5、刷新配置:

    flush privileges;

本文永久性链接:
<a href="http://r4.com.cn/art219.aspx">连接mysql时提示 is not allowed to connect to this mysql</a>
当前header:Host: r4.com.cn X-Host1: r4.com.cn X-Host2: r4.com.cn X-Host3: 127.0.0.1:8080 X-Forwarded-For: 100.28.227.63 X-Real-Ip: 100.28.227.63 X-Domain: r4.com.cn X-Request: GET /art219.aspx HTTP/1.1 X-Request-Uri: /art219.aspx Connection: close User-Agent: CCBot/2.0 (https://commoncrawl.org/faq/) Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 If-Modified-Since: Mon, 02 Oct 2023 07:56:49 GMT Accept-Encoding: br,gzip