【问题标题】:Client does not support authentication protocol requested by server客户端不支持服务器请求的认证协议
【发布时间】:2010-11-30 10:33:20
【问题描述】:

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

感谢您提供任何线索。

【问题讨论】:

标签: php mysql authentication protocols php4


【解决方案1】:

这是一个已知的 MySQL 问题。 C.5.2.4. Client does not support authentication protocol:

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. 告诉服务器使用旧的密码哈希算法。

【讨论】:

  • 这是解决方案,但我找到了解决它的直接程序(在更具体的细节上是相同的答案),我现在就给它,无论如何,谢谢!
【解决方案2】:

solution是使用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>

【讨论】:

  • 从 PHP 5.6.5 开始,您需要在 my.ini 的 [mysqld] 部分设置这些值,以启用与 mysql 4 客户端的连接: old_passwords=1 secure-auth=0 您可能还需要将mysql_old_password 添加到user db 中user 表中的plugin 部分
【解决方案3】:

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

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

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

只需重新安装 MySQL 5.5。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-03-19
    • 2023-03-05
    • 2018-10-10
    • 2018-10-29
    • 2020-12-14
    相关资源
    最近更新 更多