php 客户端不支持服务器请求的认证协议

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4312710/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 12:37:41  来源:igfitidea点击:

Client does not support authentication protocol requested by server

phpmysqlauthenticationprotocolsphp4

提问by palmic

I need to establish PHP4 environment in conjunction with mysql5 and I am facing this problem when I try to connect to mysql.

我需要结合mysql5建立PHP4环境,尝试连接mysql时遇到这个问题。

Thank you for any trace.

谢谢你的任何踪迹。

回答by palmic

The solutionis to update the database user's password using the OLD_PASSWORD function of MySQL. For example:

解决方案是使用MySQL的OLD_PASSWORD函数来更新数据库用户的密码。例如:

[chris@office ~]$ mysql -u root -p mysql

Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 267
Server version: 5.1.41-3ubuntu12.1 (Ubuntu)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use mysql;
Database changed

mysql> update user set Password=OLD_PASSWORD('password') WHERE User='username';

Query OK, 0 rows affected (0.02 sec)
Rows matched: 0  Changed: 0  Warnings: 0

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

mysql>

回答by shamittomar

It's a known MySQL problem. C.5.2.4. Client does not support authentication protocol:

这是一个已知的 MySQL 问题。C.5.2.4. 客户端不支持认证协议:

MySQL 5.1 uses an authentication protocol based on a password hashing algorithm that is incompatible with that used by older (pre-4.1) clients. If you upgrade the server from 4.0, attempts to connect to it with an older client may fail with the following message: "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:
1. Upgrade all client programs to use a 4.1.1 or newer client library.
2. When connecting to the server with a pre-4.1 client program, use an account that still has a pre-4.1-style password.
3. Reset the password to pre-4.1 style for each user that needs to use a pre-4.1 client program.
4. Tell the server to use the older password hashing algorithm.

MySQL 5.1 使用基于密码散列算法的身份验证协议,该算法与旧(4.1 之前)客户端使用的算法不兼容。如果您从 4.0 升级服务器,尝试使用旧客户端连接它可能会失败并显示以下消息:“客户端不支持服务器请求的身份验证协议;考虑升级 MySQL 客户端”。

要解决此问题,您应该使用以下方法之一:
1. 升级所有客户端程序以使用 4.1.1 或更新的客户端库。
2. 使用 4.1 之前的客户端程序连接到服务器时,请使用仍具有 4.1 之前样式密码的帐户。
3. 为每个需要使用 pre-4.1 客户端程序的用户重置密码为 pre-4.1 样式。
4. 告诉服务器使用旧密码散列算法。

回答by Pravin salunkhe

I had the same problem . I was using latest MySQl version 5.7

我有同样的问题 。我使用的是最新的 MySQl 5.7 版

Reinstalled old version of MySQL 5.5 and solved the problem.

重装旧版MySQL 5.5,问题解决。

I think there is new requirement for authentication in latest MySQL 5.7

我认为最新的 MySQL 5.7 对身份验证有新的要求

Just reinstall MySQL 5.5.

只需重新安装 MySQL 5.5。