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

新版 span sql class ring mysql 安裝 line requested cati

mysql 安裝了最新版本8.0.11後創建用戶並授權後,授權的用戶連接數據庫提示

The server requested authentication method unknown to the client

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

解決辦法:

刪除創建的用戶和授權,

  1. 找到mysql配置文件並加入
  2. default_authentication_plugin=mysql_native_password

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

  1. mysql -uroot -p
  2. use mysql;
  3. ALTER USER ‘root‘@‘localhost‘ IDENTIFIED WITH mysql_native_password BY ‘你的密碼‘;

mysql 8.0 錯誤The server requested authentication method unknown to the client