原因:由于MySQL8.0之后的加密规则为caching_sha2_password
解决方法:
1 1.docker exec -it mysql01(镜像别名) bash 3 // 进入mysql命令行 4 5 2.mysql -uroot -p 密码 6 7 // 修改加密规则 设置新密码 8 9 3.ALTER USER '账号'@'用户域' IDENTIFIED WITH mysql_native_password BY '新密码';
10 用户域
%: 全部
localhost : 只允许本地 11 // 刷新权限 12 13 4.FLUSH PRIVILEGES;