很多用戶在使用Navicat Premium 12連接MySQL數據庫時會出現Authentication plugin 'caching_sha2_password' cannot be loaded的錯誤
錯誤原因:
mysql 8.0 默認使用 caching_sha2_password 身份驗證機制 —— 從原來的 mysql_native_password 更改為 caching_sha2_password。
從 5.7 升級 8.0 版本的不會改變現有用戶的身份驗證方法,但新用戶會默認使用新的 caching_sha2_password 。
客戶端不支持新的加密方式。
解決方式:
1.進入mysql容器
docker exec -it mysql02 bash
2.登錄mysql
mysql -u root -p
3.修改賬戶密碼加密規則
ALTER USER 'root' IDENTIFIED WITH mysql_native_password BY '123456';
處理結果: