admin管理员组

文章数量:1794759

client does not support authentication protocol requested by server;consider upgrading MySQL client

client does not support authentication protocol requested by server;consider upgrading MySQL client

在连接mysql时出现如下错误, client does not support authentication protocol requested by server;consider upgrading MySQL client

  • 问题描述 在项目开发过程中,由于安装的是独立的mysql数据库,而不是集成了服务器的诸如wamserver等全家桶。就导致了如上问题的出现,虽然知道是mysql服务拒绝了客户端的连接请求,但使用如下指令给root用户授权之后还是不行。
  • grant all privileges on *.* to 'root' @'%' with grant option;

    2.问题解决 在参考了 mysql服务设置远程连接的博文之后成功得以解决,在此感谢大佬的分享,解决了这个神烦的问题。 为了避免下次遇到类似问题无法解决,故作次博文。 首先通过命令行登录mysql服务。

    mysql -u root -p

    登录成功后,切换数据库到mysql

    use mysql

    查询密码保存信

    select host,user,plugin,authentication_string from mysql.user;

    这时发现,所有用户的plugin字段数据均为sha2加密后保存的,那么在客户端发起连接时,会出现密码不匹配的情况发生,从而导致授权失败。

    修改密码并指定密码保存格式

    ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'yourpassword';

    重新查询

    select host,user,plugin,authentication_string from mysql.user;

    此时看到root用户的密码保存方式已经改为本地方式了。 到这一步,如果还不能解决,那么再重新授权一下。

    grant all privileges on *.* to 'root' @'%' with grant option;

    到此问题,得以解决。

    好记性不如烂笔头,日积月累方能登高望远__

    本文标签: authenticationprotocolClientsupportupgrading