1.用户登录指令
mysql -u root -p password;
2.修改加密方式
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
root 为当前用户名 localhost 为主机地址;
3.修改密码
alter user 'root'@'%' identified with mysql_native_password by 'root';
4.刷新权限
flush privileges;