Navicate for MySQL连接数据库时,报错:Client does not support authentication protocol requested by server;

一、利用Navicate for MySQL连接数据库时,报以上错误,可能是数据库那边配置不对,可通过以下方法解决,若打不开“MYSQL Client line command”,可参考之前的帖子。

二、报错解决方法有三种:

方法1.升级navicat驱动;

方法2.把mysql用户登录密码加密规则还原成mysql_native_password。

方法2操作步骤如下:

1、以管理者权限打开“MySQL 8.0 Command Line Client - Unicode”(这是可以输中文的命令行客户端),另外一个也可以。

在mysql的命令行里依次输入以下代码:

1| USE mysql;
2| ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '831015';
3| FLUSH PRIVILEGES;

最终结果如下:

Navicate for MySQL连接数据库时,报错:Client does not support authentication protocol requested by server;_第1张图片

方法3:在打不开 “MySQL 8.0 Command Line Client”的情况下,可进行以下操作:

1、“Win+R”打开电脑“运行”窗口,输入“cmd”加回车:

Navicate for MySQL连接数据库时,报错:Client does not support authentication protocol requested by server;_第2张图片

Navicate for MySQL连接数据库时,报错:Client does not support authentication protocol requested by server;_第3张图片

2、输入  mysql -u root -p,若出现以下情况,请看下面的3,如果没有出现,就跳过3:

Navicate for MySQL连接数据库时,报错:Client does not support authentication protocol requested by server;_第4张图片

3、这是因为没有配置环境变量,配置环境变量操作如下:

      右键“我的电脑”,选择“属性”,再选择里面的“高级系统设置”;选择“高级”,最下面选择“环境变量”:

Navicate for MySQL连接数据库时,报错:Client does not support authentication protocol requested by server;_第5张图片

   

Navicate for MySQL连接数据库时,报错:Client does not support authentication protocol requested by server;_第6张图片

          双击“path”进入编辑,在里面新建mysql的安装路径:

Navicate for MySQL连接数据库时,报错:Client does not support authentication protocol requested by server;_第7张图片

 

Navicate for MySQL连接数据库时,报错:Client does not support authentication protocol requested by server;_第8张图片

 

Navicate for MySQL连接数据库时,报错:Client does not support authentication protocol requested by server;_第9张图片

 

Navicate for MySQL连接数据库时,报错:Client does not support authentication protocol requested by server;_第10张图片

  点击“确定”保存,再重启1中所说的命令行就好。

4、打开命令行输入  mysql -u root -p,得到以下界面,输入密码:

Navicate for MySQL连接数据库时,报错:Client does not support authentication protocol requested by server;_第11张图片

 5、然后输入“ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘password’ PASSWORD EXPIRE NEVER”;#修改加密规则 
      再客户端输入“ALTER USER ‘root’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘password’;”#更新用户密码 
      FLUSH PRIVILEGES;#刷新权限
 

Navicate for MySQL连接数据库时,报错:Client does not support authentication protocol requested by server;_第12张图片

三、输入刚才修改的密码,再次测试连接,就会发现连接成功。

 

Navicate for MySQL连接数据库时,报错:Client does not support authentication protocol requested by server;_第13张图片

 

 

 

你可能感兴趣的:(mysql,navicat)