8.0之后:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的密码';
5.7:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的密码';
之前修改密码:
update mysql.user set authentication_string=password("你的密码") where user="root";
删除空账户:
delete from mysql.user where user='';
刷新:
flush privileges;

被折叠的 条评论
为什么被折叠?



