版权声明:本文系作者原创,转载请注明作者和出处!!!
解决办法:
一、在docker中启动mysql,定义端口号3306
二、执行命令,输入密码
[root@localhost ~]# docker exec -it mysql01 bash
root@863b69d78d4f:/# mysql -uroot -p
Your MySQL connection id is 8
Server version: 8.0.12 MySQL Community Server - GPL
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
三、授权
四、刷新权限
五、更改加密规则
六、更新root用户密码(123456是我的密码,要替换成自己的)
七、刷新权限
OK,可以了,再次使用 SQLyog(Navicat) 连接数据库。