解决办法
1、进入mysql容器
docker exec -it mysql bash
2、输入账号密码
mysql -uroot -p
3、权限
grant all on xxxx.* to 'root'@'%' identified by 'password' with grant option;
4、其中,xxxx代表所操作数据库名称,password为访问数据库账户的密码
注:grant all on * to 'root'@'%' identified by 'password' with grant option;自己测试时候可以用
5、重启docker mysql
docker restart mysql
完美解决