1.在Linux上登录MySQL
进入mysql-test容器:[root@VM-0-8-centos ~]# docker exec -it mysql-test /bin/bash
登录:[root@VM-0-8-centos ~]# mysql -u root -p
2.为root@% 用户授予所有操作权限
[root@VM-0-8-centos ~]# grant all privileges on . to ‘root’@‘%’ with grant option
3.刷新权限
[root@VM-0-8-centos ~]# flush privileges
4.重启容器
[root@VM-0-8-centos ~]# docker restart 容器id