1. 程式人生 > >Unable to load authentication plugin 'caching_sha2_password'

Unable to load authentication plugin 'caching_sha2_password'

**Unable to load authentication plugin 'caching_sha2_password'**

錯誤原因:聽說是由於Mysql8.0以後使用的密碼驗證方式變成了caching_sha2_password造成的。
首先我們找到mysql配置檔案my.ini:
進入MYsql的my.ini檔案
開啟,查詢default_authentication_plugin(這應該是預設驗證方式的配置)
在這裡插入圖片描述
修改前:
在這裡插入圖片描述
修改後:
在這裡插入圖片描述
然後開啟idea,再次執行,你會發現,還是報錯。別急著罵我。。因為我也是這樣。然後我關機了,過了一晚上,明天測試一下,就不報這錯誤了(原因可能是修改了配置檔案後需要重啟MYSQL使其生效)