連接MySql報錯Unable to load authentication plugin 'caching_sha2_password'.。
原因是由於mysql8 默認為caching_sha2_password,而原先為mysql_native_password。
解決方案:
在MySQL中執行
ALTER USER 'root'@'localhost' IDENTIFIED BY '密碼' PASSWORD EXPIRE NEVER;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '密碼';
FLUSH PRIVILEGES;
