一、修改表
进入mysql,mysql -u root ,如果没有root用户,那么是可以直接进入的
使用 mysql数据库
javascript
use mysql
执行 update user set host='%' where user='root';
查询 用户表
select User,Host from user

把root用户的host改为 % 允许任何主机通过root连接
二、创建root用户
SET PASSWORD FOR 'root'@'%' = '123456';

重启容器就可以了