1. 程式人生 > >mysql 報錯Authentication method 'caching_sha2_password' is not supported

mysql 報錯Authentication method 'caching_sha2_password' is not supported

原文地址:https://blog.csdn.net/u011583336/article/details/80999043

    之前工作中用的資料庫多是ms sqlserver,偶爾用到mysql都是運維配置好 ,今天心血來潮,在本地電腦安裝了一個mysql8.**的版本。建好表測試的時候發現報錯。caching_sha2_password,原因好像是,這個版本的編碼方式改變了。上網搜了好久,用上面連結的方法解決了。在這裡我想補充兩句,1安裝路徑裡面沒有配置檔案,不知道在哪裡搜的一個辦法有效,右擊這個,在

 

找到了my.ini 配置檔案(Windows系統)。2第一次按照上面連結裡的東西搞了一遍發現不可以,在mysql 資料庫中查詢  user mysql ;select plugin,authentication_string from user;           發現預設的編碼方式還是之前的,在ini裡面一查,我新增的default_authentication_plugin=mysql_native_password

下面還有一個default_authentication_plugin=caching_sha2_password 這條把我的給覆蓋了。註釋掉。重啟服務 可以了。