mysql 安裝了最新版本8.0.11后創(chuàng)建用戶并授權(quán)后,授權(quán)的用戶連接數(shù)據(jù)庫提示
The server requested authentication method unknown to the client
查閱一些相關(guān)的資料后發(fā)現(xiàn)是由于新版本的mysql賬號密碼解鎖機制不一致導致的
解決辦法:
刪除創(chuàng)建的用戶和授權(quán),
- 找到mysql配置文件并加入
- default_authentication_plugin=mysql_native_password
變?yōu)樵瓉淼尿炞C方式,然后從新創(chuàng)建用戶并授權(quán)即可
或
mysql -uroot -p
use mysql;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的密碼';
以上就是出現(xiàn)這個錯誤的解決方法,如果大家還有更好的解決方案可以給在腳本之家微信公眾號留言,感謝大家對腳本之家的支持。
您可能感興趣的文章:- Python使用QQ郵箱發(fā)送郵件報錯smtplib.SMTPAuthenticationError
- django認證系統(tǒng) Authentication使用詳解
- Java Jedis NOAUTH Authentication required問題解決方法
- 如何解決redis的NOAUTH Authentication required異常
- springboot+Oauth2實現(xiàn)自定義AuthenticationManager和認證path
- HTTP基本認證(Basic Authentication)的JAVA實例代碼
- form身份驗證通過后,只能用FormsAuthentication.RedirectFromLoginPage
- Spring Security如何基于Authentication獲取用戶信息