MySQL——DBeaver客户端连接异常

异常信息

null,  message from server: "Host '**********' is not allowed to connect to this MySQL server"

该异常信息表示只允许通过localhost方式连接,不允许远程登录,解决方案:修改远程登录权限

查看代码
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 user,host from user;
+---------------+-----------+
| user          | host      |
+---------------+-----------+
| mysql.session | localhost |
| mysql.sys     | localhost |
| root          | localhost |
+---------------+-----------+
3 rows 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 user,host from user;
+---------------+-----------+
| user          | host      |
+---------------+-----------+
| root          | %         |
| mysql.session | localhost |
| mysql.sys     | localhost |
+---------------+-----------+
3 rows in set (0.00 sec)

# 刷新
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

 

posted @ 2022-09-11 14:29  BlogMemory  阅读(715)  评论(0编辑  收藏  举报