Skip to content

1130 - Host 'WuChenDi' is not allowed to connect to this MySQL server

image.png

bash
# 进入 MySQL 安装目录 bin
$ cd /d  D:\Program Files\MySQL\MySQL Server 8.0\bin
# or
$ docker exec -it mysql-dd /bin/bash

# 登录root用户
$ mysql -u root -p;

# 查看mysql
$ use mysql;

# 查看当前主机配置信息为
$ select host from user where user='root';

# 注生产环境不可这样配置,应配置账号权限
# 设置为通配符%
$ update user set host = '%' where user ='root';

# 刷新MySQL的系统权限相关表
$ flush privileges;

image.png