Docker中安装的Mysql连接报错
使用Docker创建Mysql容器,连接到数据库报错 Host ‘x.x.x.x’ is not allowed to connect to this MySQL server 先登录到数据库 docker exec -it Mysql容器名 bash 在容器中连接到数据库 mysql -u 用户名 -p 输入密码,登上数据库,查看用户名和主机的对应表 SELECT host, user FROM mysql.user; 会显示如下的表 +————+——————+ | host | user | +————+——————+ | % | root | | 127.0.0.1 | root | | ::1 | …