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

记录下Navicat 连接MySQL8.0,错误:Authentication plugin 'caching_sha2_password' cannot be loaded

一个小白,记录每次遇到的坑。


错误分析

出现这个原因是mysql8 之前的版本中加密规则是 mysql_native_password,而在mysql8之后,加密规则是caching_sha2_password。

解决问题方法有两种:

  1. 一种是升级navicat驱动。
  2. 一种是把mysql用户登录密码加密规则还原成mysql_native_password。

方法2:

  1. 登录MySQL数据库

  2. 执行

      alter user 'root'@'localhost' identified with mysql_native_password;
    
       flush privileges;
    

最后在登录成功


原文地址:https://www.cnblogs.com/cwhan/p/12972099.html