【转】【Mysql】Navicat 连接MySQL8.0,错误:Authentication plugin 'caching_sha2_password' cannot be loaded

在使用 Navicat Premium 12 连接MySQL数据库时会出现Authentication plugin ‘caching_sha2_password’ cannot be loaded的错误(Navicat 新版本应该会修复这个问题)。

出现这个原因是mysql8 之前的版本中加密规则是 mysql_native_password,而在mysql8之后,加密规则是caching_sha2_password, 解决问题方法有两种:
一种是升级navicat驱动
一种是把mysql用户登录密码加密规则还原成mysql_native_password

还原 mysql_native_password 的方法为:

复制代码
root@mysql8:/# mysql -uroot -p                                                                                                                                                                              
Enter password:                                                                                                                                                                                             
Welcome to the MySQL monitor.  Commands end with ; or \g.                                                                                                                                                   
Your MySQL connection id is 9                                                                                                                                                                               
Server version: 8.0.16 MySQL Community Server - GPL                                                                                                                                                         
                                                                                                                                                                                                            
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.                                                                                                                                
                                                                                                                                                                                                            
Oracle is a registered trademark of Oracle Corporation and/or its                                                                                                                                           
affiliates. Other names may be trademarks of their respective                                                                                                                                               
owners.                                                                                                                                                                                            
                                                                                                                                                                                                            
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.                                                                                                                              
                                                                                                                                                                                                            
mysql> 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> ALTER USER 'root'@'localhost' IDENTIFIED BY '123456' PASSWORD EXPIRE NEVER;                                                                                                                          
Query OK, 0 rows affected (0.50 sec)                                                                                                                                                                        
                                                                                                                                                                                                            
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';                                                                                                                     
Query OK, 0 rows affected (0.24 sec)                                                                                                                                                                        
                                                                                                                                                                                                            
mysql> ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';                                                                                                                             
Query OK, 0 rows affected (0.17 sec)                                                                                                                                                                                                 
                                                                                                                                                                                                            
mysql> FLUSH PRIVILEGES;                                                                                                                                                                                    
Query OK, 0 rows affected (0.16 sec)   
————————————————
复制代码

重新使用Navicat连接。


原文链接:https://blog.csdn.net/catoop/article/details/91452090

posted @   二月无雨  阅读(124)  评论(0编辑  收藏  举报
(评论功能已被禁用)
编辑推荐:
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
点击右上角即可分享
微信分享提示