mysql8 :客戶端連接caching-sha2-password問題

一    使用pymysql版本過高導致的問題:

  問題:caching-sha2-password

處理:

    ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER; #修改加密規則 
   ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; #更新一下用戶的密碼 

   FLUSH PRIVILEGES; #刷新權限 

再重置下密碼:alter user 'root'@'localhost' identified by '123qwe';

 

 

二   使用mysql.connector版本過高導致問題:

python3.5連接mysql8.0.11 出現 mysql.connector.errors.NotSupportedError: Authentication plugin 'caching_sha2_password' is not supported 錯誤。

原因是因爲mysql8.0.11使用了Use Strong Password Encryption for Authentication即強密碼加密。

解決方法有兩種:1:重裝mysql,將Use Strong Password Encryption for Authentication改爲Use Legacy Authentication Method(在Authentication Method中改) 2:因爲python3.5以下不支持caching_sha2_password,可使用python3.6進行連接
 

 

--------------------- 
作者:5515 
來源:CSDN 
原文:https://blog.csdn.net/u010026255/article/details/80062153 
版權聲明:本文爲博主原創文章,轉載請附上博文鏈接!

 

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