Mysql_connect (): Connection using old (pre-4.1.1) authentication protocol refused

Source: Internet
Author: User
Tags mysql manual

After a mysql upgrade, mysql on the development machine is upgraded to mysql 5.6. As a result, the following exception is reported when the mysql server of some earlier versions is connected:
Warning: mysql_connect (): Connection using old (pre-4.1.1) authentication protocol refused (client option 'Secure _ auth' enabled)

The cause of the exception is that the password management protocol on the server is outdated, and the old User Password format is used for storage. However, after the client is upgraded, the new password format is used. If this inconsistency occurs in MySQL, the connection is denied.

See the description of the -- secure-auth option in the "Server Command Options" section of the mysql Manual: http://dev.mysql.com/doc/refman/5.6/en/server-options.html#option_mysqld_secure-auth


There are three solutions:

1. Enable secure_auth for server upgrade;

2. Disable secure_auth when connecting the client, that is, add -- secure_auth = off when connecting, for example, mysql-p10.51.1.11-P3308-uroot -- secure_auth = off.

3. Find the corresponding mysql user and change the PASSWORD to the new encryption method, password ('your password'), such:
Copy codeThe Code is as follows: set password for root = PASSWORD ('20140901 ');

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.