标签:load sha2 plugin 005 mysql caching password localhost
使用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\nQzL}}th,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$x{eSdQq9(@)>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$x{eSdQq9(@)>rzX&p5FhZqlP0p6BNJgunFY9FWjw8JlqywS5ANOdxzCODfZD |
+------------------+-----------+-----------------------+------------------------------------------------------------------------+
6 rows in set (0.00 sec)
可以看到test用户的plugin变为mysql_native_password
这样就能用DBeaver连接啦:
标签:load,sha2,plugin,005,mysql,caching,password,localhost 来源: https://blog.csdn.net/lishuangquan1987/article/details/121974655
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。