进入mysql后
flush privileges;
- 修改密码。这里’root’@’%'是 用户名@host。如果是mysql.user中root是127.0.0.1,host可以写localhost。
alter user 'root'@'%' identified with mysql_native_password by 'root';
进入mysql后
flush privileges;
alter user 'root'@'%' identified with mysql_native_password by 'root';