navicat连接虚拟机中的docker容器中的mysql数据库出错:1130-host is not allowed to connect

navicat连接虚拟机中的docker容器中的mysql数据库出错:1130-host is not allowed to connect

可能是不允许远程访问,需进入mysql中修改用户对应的host,从“localhost”修改成“%”。
过程如下:

进入docker容器

navicat连接虚拟机中的docker容器中的mysql数据库出错:1130-host is not allowed to connect

修改host

navicat连接虚拟机中的docker容器中的mysql数据库出错:1130-host is not allowed to connect
退出后重启mysql容器即可。