1.打开MySQL 8.0 Command Line Client
2.挨个执行下面的语句,就是更改mysql的加密方式然后重置密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;
#修改加密规则
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
#更新一下用户的密码 FLUSH PRIVILEGES;
#刷新权限
alter user 'root'@'localhost' identified by '此处填写真实的密码';这一步设置真实的密码';