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
。 - 关于两个插架的讨论