MYSQL出现" Client does not support authentication "的解决方法

所属分类: 数据库 / Mysql 阅读数: 770
收藏 0 赞 0 分享

MYSQL 帮助:

A.2.3 Client does not support authentication protocol

MySQL 4.1 and up uses an authentication protocol based on a password hashing algorithm that is incompatible with that used by older clients. If you upgrade the server to 4.1, attempts to connect to it with an older client may fail with the following message:

shell> mysql
Client does not support authentication protocol requested
by server; consider upgrading MySQL client

To solve this problem, you should use one of the following approaches:

  • Upgrade all client programs to use a 4.1.1 or newer client library.
  • When connecting to the server with a pre-4.1 client program, use an account that still has a pre-4.1-style password.
  • Reset the password to pre-4.1 style for each user that needs to use a pre-4.1 client program. This can be done using the SET PASSWORD statement and the OLD_PASSWORD() function:
    mysql> SET PASSWORD FOR
      -> 'some_user'@'some_host' = OLD_PASSWORD('newpwd');
    Alternatively, use UPDATE and FLUSH PRIVILEGES:
    mysql> UPDATE mysql.user SET Password = OLD_PASSWORD('newpwd')
      -> WHERE Host = 'some_host' AND User = 'some_user';
    mysql> FLUSH PRIVILEGES;
    Substitute the password you want to use for ``newpwd'' in the preceding examples. MySQL cannot tell you what the original password was, so you'll need to pick a new one.
  • Tell the server to use the older password hashing algorithm:
    1. Start mysqld with the --old-passwords option.
    2. Assign an old-format password to each account that has had its password updated to the longer 4.1 format. You can identify these accounts with the following query:
      mysql> SELECT Host, User, Password FROM mysql.user
        -> WHERE LENGTH(Password) > 16;
      For each account record displayed by the query, use the Host and User values and assign a password using the OLD_PASSWORD() function and either SET PASSWORD or UPDATE, as described earlier.

For additional background on password hashing and authentication, see section 5.5.9 Password Hashing in MySQL 4.1.

更多精彩内容其他人还在看

聊聊MySQL中的参数

这篇文章主要介绍了MySQL中的参数是什么,帮助大家更好的理解和使用MySQL数据库,感兴趣的朋友可以了解下
收藏 0 赞 0 分享

MySQL8.0 如何快速加列

这篇文章主要介绍了MySQL8.0 如何快速加列,帮助大家更好的理解和使用MySQL数据库,感兴趣的朋友可以了解下
收藏 0 赞 0 分享

MYSQL中 char 和 varchar的区别

这篇文章主要介绍了MYSQL中 char 和 varchar的区别,帮助大家更好的理解和使用MySQL数据库,感兴趣的朋友可以了解下
收藏 0 赞 0 分享

MySQL存储过程及常用函数代码解析

这篇文章主要介绍了MySQL存储过程及常用函数代码解析,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
收藏 0 赞 0 分享

如何解决mysql insert乱码的问题

在本篇内容里小编给大家整理的是一篇关于如何解决mysql insert乱码的问题的相关文章,有兴趣的朋友们可以学习参考下。
收藏 0 赞 0 分享

详解MySQL InnoDB的索引扩展

这篇文章主要介绍了MySQL InnoDB的索引扩展的相关资料,帮助大家更好的理解和学习MySQL,感兴趣的朋友可以了解下
收藏 0 赞 0 分享

MySQL数据延迟跳动的问题解决

这篇文章主要介绍了MySQL数据延迟跳动的问题如何解决,帮助大家更好的理解和学习MySQL,感兴趣的朋友可以了解下
收藏 0 赞 0 分享

超详细MySQL使用规范分享

这篇文章主要介绍了MySQL使用规范,帮助大家更规范的操作MySQL,感兴趣的朋友可以了解下
收藏 0 赞 0 分享

MySQL中常见的几种日志汇总

这篇文章主要给大家介绍了关于MySQL中常见的几种日志,文中通过实例代码结束的非常详细,对大家学习或者使用MySQL具有一定的参考学习价值,需要的朋友们下面来一起学习学习吧
收藏 0 赞 0 分享

MYSQL SERVER收缩日志文件实现方法

这篇文章主要介绍了MYSQL SERVER收缩日志文件实现方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
收藏 0 赞 0 分享
查看更多