參考:https://www.cnblogs.com/live41/p/13833337.html
使用MySQL版本為8.0.26在連接MySQL時報錯
原因分析:
MySQL新版默認使用caching_sha2_password作為身份驗證插件,而舊版是使用mysql_native_password。
當連接MySQL時報錯“plugin caching_sha2_password could not be loaded”時,可換回舊版插件。
解決方法
mysql -hlocalhost -uroot -p123456 //進入數據庫
use mysql;
ALTER USER root@localhost IDENTIFIED WITH mysql_native_password BY '123456'; //123456是密碼
FLUSH PRIVILEGES