mysql遷移至8.0時的注意事項(小結)
密碼模式
PDO::__construct(): The server requested authentication method unknown to the client [caching_sha2_password]
mysql8 之后,默認的密碼模式改為 caching_sha2_password,新的模式需要新的驅動,至少現(xiàn)在 pdo / navicat 還沒給出,所以我們還是得切換成老的 mysql_native_password 模式。
`mysql_native_password`:7.0 以下 `caching_sha2_password`:8.0 以上
1、my.cnf 配置默認的密碼模式
[mysqld] default_authentication_plugin=mysql_native_password
2、更新賬號的密碼模式
# 創(chuàng)建新的賬號 create user 'root'@'%' identified with mysql_native_password by '123456'; # 已存在的賬號 alter user 'root'@'%' identified with mysql_native_password by '123456';
3、如果你需要授權
# 授權也不能兼并創(chuàng)建賬號了,只能授權 grant all privileges on *.* to 'root'@'%' with grant option; flush privileges;
密碼復雜度策略
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
密碼復雜度驗證策略導致的,關閉后設定即可
set global validate_password.policy=0; set global validate_password.length=6;
默認編碼
PDO::__construct(): Server sent charset (255) unknown to the client. Please, report to the developers
設定 mysql 服務的默認編碼
# Default Homebrew MySQL server config [client] default_character_set=utf8mb4 [mysql] default_character_set=utf8mb4 [mysqld] default_authentication_plugin=mysql_native_password character_set_server=utf8mb4 collation_server=utf8mb4_general_ci
遠程訪問
1、my.conf 注釋掉本地監(jiān)聽
[mysqld] #bind_address=127.0.0.1
2、更新賬號的 host
update mysql.user set host='%' where user='root';
到此這篇關于mysql遷移至8.0時的注意事項(小結)的文章就介紹到這了,更多相關mysql遷移至8.0內容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!
相關文章
Mac OS系統(tǒng)下mysql 5.7.20安裝教程圖文詳解
這篇文章主要介紹了Mac OS系統(tǒng)下mysql 5.7.20安裝教程圖文詳解,本文給大家介紹的非常詳細,具有參考借鑒價值,需要的朋友可以參考下2017-11-11MySQL5.6升級5.7時出現(xiàn)主從延遲問題排查過程
這篇文章主要介紹了MySQL5.6升級5.7時出現(xiàn)主從延遲問題排查過程,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2020-09-09簡單了解MYSQL數(shù)據(jù)庫優(yōu)化階段
這篇文章主要介紹了簡單了解MYSQL數(shù)據(jù)庫優(yōu)化階段,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友可以參考下2020-04-04