SQL
alter user 'root'@'%' identified with mysql_native_password by 'root';
# 針對版本 mysql8.0 不同版本語法可能不同
# with 後面跟驗證插件 by後面跟密碼
#
參數解釋
- idetified with +驗證插件
- by + 密碼
- ‘root’@’%’
- root用戶名
- % 域名
涉及的庫表
- mysql.user (系統表)
驗證插件
- 解釋 在MySQL 8.0中,
caching_sha2_password
是默認的身份驗證插件,而不是mysql_native_password
。 - 關於兩個插架的討論