主頁 > 知識庫 > mysql遷移至8.0時的注意事項(小結)

mysql遷移至8.0時的注意事項(小結)

熱門標簽:上海市三維地圖標注 電話機器人是電腦呼號嗎 南寧外呼系統(tǒng)招商 博樂電銷機器人 云南大數據外呼系統(tǒng) 400電話到哪辦理優(yōu)惠 鄭州網絡外呼系統(tǒng)價錢 機器人打電銷電話 怎么更改高德地圖標注

密碼模式

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及對應驅動包匹配的注意點說明

標簽:杭州 寧夏 益陽 恩施 秦皇島 定西 澳門 白銀

巨人網絡通訊聲明:本文標題《mysql遷移至8.0時的注意事項(小結)》,本文關鍵詞  mysql,遷,移至,8.0時,的,注意事項,;如發(fā)現本文內容存在版權問題,煩請?zhí)峁┫嚓P信息告之我們,我們將及時溝通與處理。本站內容系統(tǒng)采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《mysql遷移至8.0時的注意事項(小結)》相關的同類信息!
  • 本頁收集關于mysql遷移至8.0時的注意事項(小結)的相關信息資訊供網民參考!
  • 推薦文章