1、进入数据库 2、更改加密方式: alter user ‘root’@‘localhost’ identified by ‘password’ password expire never; 3、更改密码: alter user ‘root’@‘localhost’ identified with mysql_native_password by ‘新密码’; 4、更新: flush privileges
用 navicat 链接时若报错1251可采取一下方法解决:(只用于mysql 8.0以上版本)1、进入数据库2、更改加密方式:alter user ‘root’@‘localhost’ identified by ‘password’ password expire never;3、更改密码:alter user ‘root’@‘localhost’ identified with mysql_native_password by ‘新密码’;4、更新:flush privileges.