密碼模式
PDO::__construct(): The server requested authentication method unknown to the client [caching_sha2_password]
mysql8 之后,默認的密碼模式改為 caching_sha2_password,新的模式需要新的驅動,至少現在 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ù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!
您可能感興趣的文章:- 淺談mysql8.0新特性的坑和解決辦法(小結)
- mysql8.0.20安裝與連接navicat的方法及注意事項
- 使用JDBC連接Mysql 8.0.11出現了各種錯誤的解決
- 詳解關于MySQL 8.0走過的坑
- MySql 8.0及對應驅動包匹配的注意點說明