MySQL 报错: “Host ‘xxx‘ is not allowed to connect to this MySQL server“

1.使用 MySQL 命令行工具

登录到 MySQL 服务器上。

使用 mysql​ 命令行工具以 root 用户或具有足够权限的用户身份登录。

mysql -u root -p 

 输入密码后,选择 mysql​ 数据库。

use mysql;

查看当前的用户和权限设置 

select host, user from user; 

  更新对应用户的权限,允许从任何主机连接。

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

 刷新权限。

 flush privileges;

你可能感兴趣的:(mysql,数据库)