- 先通过命令行进入mysql的root账户:
-
更改加密方式
1 ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;
- 更改密码
1 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
- 刷新
1 FLUSH PRIVILEGES;
更改加密方式
1 ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;
1 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
1 FLUSH PRIVILEGES;