1. 程式人生 > 資料庫 >mysql 8.0 錯誤The server requested authentication method unknown to the client解決方法

mysql 8.0 錯誤The server requested authentication method unknown to the client解決方法

mysql 安裝了最新版本8.0.11後建立使用者並授權後,授權的使用者連線資料庫提示

The server requested authentication method unknown to the client

查閱一些相關的資料後發現是由於新版本的mysql賬號密碼解鎖機制不一致導致的

解決辦法:

刪除建立的使用者和授權,

  1. 找到mysql配置檔案並加入
  2. default_authentication_plugin=mysql_native_password

變為原來的驗證方式,然後從新建立使用者並授權即可

mysql -uroot -p
use mysql;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的密碼';

以上就是出現這個錯誤的解決方法,如果大家還有更好的解決方案可以給在我們微信公眾號留言,感謝大家對我們的支援。