
一、問題原因:
如上圖的報錯提示可知,報錯原因是caching_sha2_password不能加載。
這是因為8.0之后mysql更改了密碼的加密規則,而目前已有的客戶端連接軟件還不支持Mysql8新增加的加密方式caching_sha2_password,所以我們需要修改用戶的加密方式,將其改為老的加密驗證方式。
二、解決步驟:
1、在win的左下角,輸入cmd,打開cmd窗口


2、進入到mysql的安裝目錄bin目錄下

3、登錄mysql
mysql -u root -p

4、修改加密規則
alter user root@localhost identified by 'password' password expire never;
5、更新密碼
alter user root@localhost identified with mysql_native_password by 'password';
6、刷新
flush privileges;
7、在客戶端測試連接,連接成功。

