第一步:登入
mysql -u root -p
第二步:查看加密规程
select user,plugin from user where user='root'; 结果显示 +------+-----------------------+ | user | plugin | +------+-----------------------+ | root | caching_sha2_password | +------+-----------------------+
第三步:修改加密规则
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;
第四步:重修修改密码
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '131556';
第五步:刷新
FLUSH PRIVILEGES;