MySQL client does not support authentication protocol solution

Source: Internet
Author: User
Tags what php
MySQL5.1 adopts an authentication protocol based on the cryptographic mixed encoding algorithm, which is incompatible with the protocol used by the early client (before 4.1. If you upgrade the server to MySQL 4.1, the connection may fail with an earlier client and the following message is displayed: The shellmysql client does not support the authentication protocol for server requests: consider upgrading the MySQL client. To solve

MySQL 5.1 adopts an authentication protocol based on the cryptographic mixed encoding algorithm, which is incompatible with the protocol used by earlier clients (before MySQL 4.1. If you upgrade the server to mysql 4.1, the connection may fail with an earlier client and the following message is displayed: The shell MySQL client does not support the authentication protocol for server requests: consider upgrading the mysql client. To solve

MySQL 5.1 adopts an authentication protocol based on the cryptographic mixed encoding algorithm, which is incompatible with the protocol used by earlier clients (before MySQL 4.1. If you upgrade the server to 4.1, connection with an earlier client may fail and the following message is displayed:

Shell> mysql

The client does not support the authentication protocol for server requests: consider upgrading the MySQL client.

To solve this problem, use one of the following methods:

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

· When you connect to the server using a client earlier than Version 4.1, use an account that still has a password earlier than Version 4.1.

· For each user who needs to use a client before version 4.1, the password will be restored to the style before version 4.1. You can use the set password statement and the OLD_PASSWORD () function to complete 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 newpwd with the password you intend to use ". MySQL cannot tell you what the original password is. Therefore, you need to select a new password.

· Notify the server to use the old password mixing algorithm:

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

2. For each account whose password has been updated to a longer 4.1 format, specify a password in the old format. You can use the following query to determine these accounts:

3.

Mysql> SELECT Host, User, Password FROM mysql. user

4.

-> Where length (Password)> 16;

For each account record displayed in the query, use the Host and User values, and use the OLD_PASSWORD () function and one of set password or UPDATE to specify the PASSWORD, as described above.

Note: In earlier PHP versions, mysql extensions do not support authentication protocols in MySQL 4.1.1 and later versions. No matter what PHP version is used, it is correct. If you plan to use MySQL extension with mysql 4.1 or later, you need to use one of the options described earlier to configure MySQL for use with earlier clients. Mysqli extension (support for "Improved MySQL" and added in PHP 5) is compatible with the improved password mixing Algorithm Used in MySQL 4.1 and later versions, the MySQL client library can be used without special configuration for MySQL.

Note: For more exciting tutorials, please pay attention to the Sanlian graphic tutorial channel,

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.