EKsumic's Blog

let today = new Beginning();

Click the left button to use the catalog.

OR

SQLyog錯誤號碼2058最快解決方法

SQLyog錯誤號碼2058最快解決方法

先進入mysql的命令行

select user,host,plugin from mysql.user;

看看他們的plugin用的什麽方式

mysql> select user,host,plugin from mysql.user;
+------------------+-----------+-----------------------+
| user             | host      | plugin                |
+------------------+-----------+-----------------------+
| root             | %         | caching_sha2_password |
| debian-sys-maint | localhost | caching_sha2_password |
| mysql.infoschema | localhost | caching_sha2_password |
| mysql.session    | localhost | caching_sha2_password |
| mysql.sys        | localhost | caching_sha2_password |
| root             | localhost | mysql_native_password |
+------------------+-----------+-----------------------+
6 rows in set (0.00 sec)

這個已經是我部分修改好的,

如果你需要遠程鏈接mysql,你必須

ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'your_password';
FLUSH PRIVILEGES;

這樣才能擺脫caching_sha2_password的驗證問題。

當然如果你沒有root@%這個用戶,那你就必須創建了:

CREATE USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'new_password';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;

説到底,這只是最快的解決方法。(只適合測試環境)

最好的解決方案還是去弄懂caching_sha2_password的驗證。

This article was last edited at 2024-07-07 20:46:42

Today's comments have reached the limit. If you want to comment, please wait until tomorrow (UTC-Time).

There is 16h08m21s left until you can comment.