Unable to load authentication plugin ‘caching_sha2_password‘
Posted lishuangquan1987
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Unable to load authentication plugin ‘caching_sha2_password‘相关的知识,希望对你有一定的参考价值。
使用DBeaver连接mysql时报Unable to load authentication plugin 'caching_sha2_password
原因:Mysql8.0以上默认使用密码加密规则为caching_sha2_password
需要修改为mysql_native_password
:
use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select user,host,plugin,authentication_string from user;
+------------------+-----------+-----------------------+------------------------------------------------------------------------+
| user | host | plugin | authentication_string |
+------------------+-----------+-----------------------+------------------------------------------------------------------------+
| root | % | caching_sha2_password | $A$005$v8lm8j[1U_iz%?rhHztGex9Z6H74IQjIOkhc6V3y/PPZnVGuHIeuWJtXLe/ |
| test | % | caching_sha2_password | $A$005$?Eq\\nQzLth,b0WMVhOhTrGCDok8A7R.HPSm/nHnzwfVH0fiufJEjAkD |
| mysql.infoschema | localhost | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED |
| mysql.session | localhost | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED |
| mysql.sys | localhost | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED |
| root | localhost | caching_sha2_password | $A$005$xeSdQq9(@)>rzX&p5FhZqlP0p6BNJgunFY9FWjw8JlqywS5ANOdxzCODfZD |
+------------------+-----------+-----------------------+------------------------------------------------------------------------+
6 rows in set (0.00 sec)
mysql> alter user 'test'@'%' identified with mysql_native_password by 'Test@123';
Query OK, 0 rows affected (0.01 sec)
mysql> select user,host,plugin,authentication_string from user;
+------------------+-----------+-----------------------+------------------------------------------------------------------------+
| user | host | plugin | authentication_string |
+------------------+-----------+-----------------------+------------------------------------------------------------------------+
| root | % | caching_sha2_password | $A$005$v8lm8j[1U_iz%?rhHztGex9Z6H74IQjIOkhc6V3y/PPZnVGuHIeuWJtXLe/ |
| test | % | mysql_native_password | *BCF4F28E525ED7EE4664FFFF4DAE13EC14A6ABE1 |
| mysql.infoschema | localhost | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED |
| mysql.session | localhost | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED |
| mysql.sys | localhost | caching_sha2_password | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED |
| root | localhost | caching_sha2_password | $A$005$xeSdQq9(@)>rzX&p5FhZqlP0p6BNJgunFY9FWjw8JlqywS5ANOdxzCODfZD |
+------------------+-----------+-----------------------+------------------------------------------------------------------------+
6 rows in set (0.00 sec)
可以看到test用户的plugin变为mysql_native_password
这样就能用DBeaver连接啦:
以上是关于Unable to load authentication plugin ‘caching_sha2_password‘的主要内容,如果未能解决你的问题,请参考以下文章
Unable to load dispatcher.filter.StrutsPrepareAndExecuteFilter
Excel Web Access 报错:Unable to Load Workbook
Unable to load configuration. - [unknown location]