4

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

Thank you for any trace.

Winter
  • 3,894
  • 7
  • 24
  • 56
palmic
  • 1,846
  • 2
  • 20
  • 30

3 Answers3

7

The solution is to update the database user’s password using the OLD_PASSWORD function of MySQL. For example:

[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>
Victor Marchuk
  • 13,045
  • 12
  • 43
  • 67
palmic
  • 1,846
  • 2
  • 20
  • 30
  • 1
    As of PHP 5.6.5 you need to set these values in the `[mysqld]` section of `my.ini`, to be enable to connect with mysql 4 clients: old_passwords=1 secure-auth=0 You might also need to add `mysql_old_password` to the `plugin` section in the `user` table in the `mysql` db – Wertisdk Nov 06 '13 at 10:52
3

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

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.

shamittomar
  • 46,210
  • 12
  • 74
  • 78
  • That's solution, but i found direct procedure to solve it (which is the same answer in more concrete details), i gave it here right now, THX anyway! – palmic Dec 01 '10 at 10:39
0

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

Reinstalled old version of MySQL 5.5 and solved the problem.

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

Just reinstall MySQL 5.5.