mysql_connect of : Connection using old of pre 4.1.1 authentication protocol refused

  • 2020-06-15 10:23:35
  • OfStack

I made 1 mysql upgrade, and the mysql on the development machine was upgraded to version 5.6. As a result, I connected to some lower-version mysql servers and reported the following exceptions:
Warning: mysql_connect(): Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)

The reason for the exception is that the password management protocol on the server side is old, and it USES the old user password format. However, the client upgraded to a new password format. Version 5.6 of mysql rejects the connection in this case.

See mysql manual "Server Command Options" "- secure - auth" in verse 1 options: http: / / dev mysql. com/doc refman / 5.6 / en/server - options. html # option_mysqld_secure - auth


There are three solutions:

1. Enable secure_auth option for server-side upgrade;

2. off drops secure_auth when the client connects, that is, add --secure_auth=off when connecting, such as: ES46en-p10.51.1.11-P3308-ES49en --secure_auth=off

3. Find the corresponding mysql user and change the password to the new encryption method, PASSWORD(' your password'), as follows:

SET PASSWORD FOR root=PASSWORD('123456');

For method 2, use the corresponding mysql configuration in the program. Take php as an example, set secure_auth=off in ES65en.ini


Related articles: