1. portainer 中进入mysql容器

2. 输入命令 mysql -uroot

3. 输入命令赋予权限 并设置密码 : grant all privileges on *.* to root@'%' identified by '123456' with grant option;

4. 输入命令进行刷新: flush privileges;

5. 关闭退出 : quit;

6. 在portainer 中重启mysql 容器

 7. 打开sqlyog进行连接

 

更多推荐

在虚拟机中连接mysql数据库