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

Source: Internet
Author: User

Do a bit of MySQL upgrade, the development of MySQL upgrade to version 5.6, the result of connecting some of the lower version of the MySQL server reported the following exception:
Warning:mysql_connect (): Connection using old (pre-4.1.1) authentication protocol refused (client option ' Secure_auth ' en abled)

The exception is because the server-side password Management protocol is stale, using the old user password format store, but the client is upgraded with a new password format. When the mysql5.6 version encounters this inconsistency, it rejects the connection.

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


There are three ways to solve the problem:

1, server-side upgrade enable Secure_auth option;

2, the client connection off Secure_auth, that is, when connected with--secure_auth=off, such as: Mysql-p10.51.1.11-p3308-uroot--secure_auth=off

3, find the corresponding MySQL user password to the new encryption method, PASSWORD (' Your PASSWORD '), such as:

Copy Code code as follows:
SET PASSWORD for Root=password (' 123456 ');

For method Two, use in the program to do the appropriate MySQL configuration can, in PHP as an example, in php.ini set Secure_auth=off

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.