连接数据库时出现Http “xxxxxx” is not allowed to connect to this Mysql server的解决办法
我采用docker创建的mysql容器
docker exec -it sql mysql -u root -proot
进入mysql
(1)use mysql;
(2)select host from user where user='root';
这样是代表只支持本地
(3)update user set host='%' where user='root';
修改localhost为通配符“%”
(4) flush privileges;让当前配置立即生效
之后就连接成功