2018年9月18日 星期二

MySQL 8.0 更改為native password 及 忘記密碼重設



更改為native password

[mysqld]
default-authentication-plugin=mysql_native_password

新的
default-authentication-plugin=caching_sha2_password

這樣子沒用,會造成原本的root無法登入。
mysql> alter user 'root'@'localhost' identified with mysql_native_password by 'password';


移除password validate 


UNINSTALL COMPONENT 'file://component_validate_password';


重設密碼


Stop the MySQL server if necessary, then restart it with the --skip-grant-tables
shell> mysql
mysql> FLUSH PRIVILEGES;
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';

沒有留言:

張貼留言