MySQL client does not support authentication protocol resolution

Source: Internet
Author: User
Tags flush mysql client

MySQL 5.1 employs an authentication protocol based on the password-mix algorithm, which is incompatible with the protocol used by the earlier client (before 4.1). If you upgrade the server to 4.1, connecting with an earlier client may fail with the following message:

     
     shell> MySQL

The client does not support the authentication protocol requested by the server: please consider upgrading the MySQL client.

To resolve this issue, you should use one of the following methods:

• Upgrade all client programs to use the 4.1.1 or updated client library.

• Use an account that still has a style password prior to version 4.1 when connecting to the server with a client prior to version 4.1.

• Restore the password to the style before version 4.1 for each user who needs to use the client before version 4.1. You can use the Set PASSWORD statement and the Old_password () function to accomplish this task:

     
     mysql> SET PASSWORD for
-> ' some_user ' @ ' some_host ' = Old_password (' newpwd ');
You can also use Update and flush privileges:
mysql> update mysql.user SET Password = Old_password (' newpwd ')
-> WHERE Host = ' Some_host ' and User = ' some_user ';
mysql> FLUSH privileges;

Replace the "newpwd" in the precedent with the password you intend to use. MySQL cannot tell you what the original password is, so you need to select a new password.

• Notifies the server to use the old password-mix algorithm:

1. Use the "--old-passwords" option to start the mysqld.

2. For each account for which the password has been updated to a longer 4.1 format, specify the password with the old format. These accounts can be determined using the following query:

3.

     
     Mysql> SELECT Host, User, Password from Mysql.user

4.

     
     -> WHERE LENGTH (Password) > 16;

For each account record that the query displays, use the host and user values and specify the password using the Old_password () function and one of the set PASSWORD or update, as described earlier.

Note: In earlier versions of PHP, MySQL extensions did not support the authentication protocol in the MySQL 4.1.1 and higher editions. Whatever PHP version is used, it is correct. If you plan to use MySQL extensions with MySQL 4.1 or later, you need to configure MySQL to work with older clients using one of the options described earlier. The mysqli extension (which supports "improved MySQL", added in PHP 5) is compatible with the improved password mix algorithm used in MySQL 4.1 and later, and does not require a special configuration of MySQL to use the MySQL client library.

Note : For more wonderful tutorials, please pay attention to the triple graphics tutorial channel,

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.