2059 - Authentication plugin 'caching_sha2_password' cannot be loaded

本地之前有数据库,后来装了mysql8.0 导致本地连接不上去

 

2059 - Authentication plugin 'caching_sha2_password' cannot be loaded_第1张图片

可以通过mysql自带的命令行工具 进入mysql

2059 - Authentication plugin 'caching_sha2_password' cannot be loaded_第2张图片

1 选择数据库mysql

mysql> use mysql
Database changed
mysql> select user,host,plugin,authentication_string from user;

2059 - Authentication plugin 'caching_sha2_password' cannot be loaded_第3张图片

2 更改加密方式

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;
Query OK, 0 rows affected (0.10 sec)

3 更改密码

mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
Query OK, 0 rows affected (0.35 sec)

4 刷新权限

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.28 sec)

再次连接ok!!!

你可能感兴趣的:(杂记,Mysql)