Navicat连接Mysql出现“plugin caching_sha_password cannot be loaded”错误

发布时间 2023-07-24 15:46:02作者: 安浩阳

Navicat连接Mysql出现“plugin 'caching_sha_password' cannot be loaded”错误

问题现场

**官方说明:**​https://dev.mysql.com/doc/refman/8.0/en/caching-sha2-pluggable-authentication.html

解决方案

  1. 使用本地mysql命令行登录;

    mysql -uroot -p
    
  2. 先查一下看看

    --使用mysql库
    USE mysql;
    

    --查询一下
    SELECT Host, User, plugin from user;

    检查下“localhost”和“%”都应该为“mysql_native_password”

    image​​

  3. 修改登录验证方式

    --修改登录验证方式
    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
    ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
    

    --使其生效
    FLUSH PRIVILEGES;

  4. 验证下