Client does not support authentication protocol requested by serverconsider upgrading MySQL client

參考自: https://blog.csdn.net/qq_42068550/article/details/91411091?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522159037627619725247640233%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=159037627619725247640233&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~first_rank_v2~rank_v28-1-91411091.first_rank_v2_rank_v28&utm_term=Java%E8%BF%9E%E6%8E%A5Mysql%E6%8A%A5%E9%94%99%EF%BC%9AClient+does+not+

Java編程時,使用DriverManager.getConnection()函數連接MYSQL時,報錯:   Client does not support authentication protocol requested by server; consider upgrading MySQL client

大概意思是:客戶端不支持服務器請求的身份驗證協議;考慮升級MySQL客戶端
 

解決方法如下:

登錄mysql,輸入如下命令即可。

alter user 'root'@'localhost' identified with mysql_native_password by '123456';
flush privileges;

這樣就能解決這個問題了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章