連接MySQL報錯: Unable to load authentication plugin caching_sha2_password

Intro

我在使用 DBeaver 7.0.4 連接 MySQL 8.0.20的時候出現了這個錯誤。

經查,是由MySQL服務器端的密碼驗證策略的問題導致(具體是什麼策略,和MySQL服務器的版本高低也有關)。
解決方法:解決MySQL服務器的密碼驗證策略的一些參數。

  • 解決
    root用戶登錄MySQL,執行以下三條命令(其中12345是你的root賬號密碼)。
alter user 'root'@'localhost' identified by '12345' password expire never;

alter user 'root'@'localhost' identified with mysql_native_password by '12345';

flush privileges;
  • 再次測試連接:
    在這裏插入圖片描述
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章