需要注意的是数据库user表中会有两个root用户,一个是本地登录用户,一个是远程登录用户,修改密码的时候需要区分。
# 切换到mysql库
use mysql;
# 修改本地登录的root用户
update user set authentication_string=password('123456') where user='root' and Host='localhost';
# 修改远程登录的root用户
update user set authentication_string=password('123456') where User='root' and Host='%';
# 刷新
flush privileges;
欢迎关注微信公众号:【皮卡战记】
