Navicat连接MySQL,出现2059 - authentication plugin 'caching_sha2_password'的解决方案

时间:2023-03-09 03:37:39
Navicat连接MySQL,出现2059 - authentication plugin 'caching_sha2_password'的解决方案

    昨天当我把MySQL的安装程序下载并安装好,然后又下载了另外一个工具来使用它,该工具的名称是Navicat Premium,当我通过该工具连接MySQL Workbench的时候,无法连接,提示“2059 - authentication plugin 'caching_sha2_password'”,今天搞了一段时间终于搞定了,具体的解决办法已经写下来了。

Navicat连接MySQL,出现2059 - authentication plugin 'caching_sha2_password'的解决方案

Navicat连接MySQL,出现2059 - authentication plugin 'caching_sha2_password'的解决方案

进入MySQL控制台,执行如下命令:
通过使用命令行工具(MySql 8.0 Command Line Client)执行设置的修改,我们先登陆MySql的客户端,执行以下命令就可以了。

use mysql;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'liulei123';
'是英文的单引号

这里的localhost对应本地,如果是远程访问 mysql的话,需要将localhost改成%;
password是root的密码,使用时也要进行对应修改。