【navicat 连接错误】2059 - authentication plugin ‘caching_sha2_password‘的解决方法

问题描述

在windows本地安装mysql之后,使用Navicat连接,然后报错:

2059 - Authentication plugin ‘caching_sha2_password’ cannot be loaded

原因分析:

Mysql8新增加的加密方式:caching_sha2_password,但是Navicat并不支持。所以需要将验证方式改为原来旧的验证方式:mysql_native_password

解决方案:

1.win+R运行 输入cmd(别按回车)

【navicat 连接错误】2059 - authentication plugin ‘caching_sha2_password‘的解决方法_第1张图片

2.ctrl+shift+enter 管理员身份运行cmd
【navicat 连接错误】2059 - authentication plugin ‘caching_sha2_password‘的解决方法_第2张图片

3.输入以下图片中的代码可以查看mysql的加密验证方式,主要看localhost—root那一行

2【navicat 连接错误】2059 - authentication plugin ‘caching_sha2_password‘的解决方法_第3张图片

4.运行下列两行代码修改加密验证方式

ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘你的密码’ PASSWORD EXPIRE NEVER;

ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘你的密码’;

5.修改完成之后,可以查看是否成功
【navicat 连接错误】2059 - authentication plugin ‘caching_sha2_password‘的解决方法_第4张图片

可以看到已经改成功了

你可能感兴趣的:(mysql,数据库,database)