PHP5 Connection MYSQL5 Authentication protocol Problem _php Tutorial

Source: Internet
Author: User
After MYSQL 4.1, adopted a new user authentication protocol, for the old client will appear does not support the authentication protocol error, the following is the official website solution;
1Upgrade all client programs to use a 4.1.1 or newer client library.
Update the client library, which needs to update the PHP extension library, for the old API PHP has not provided such an extension library
2When connecting to the server with a pre-4.1 client program, the use of the account that still have a pre-4.1-style password.
Using a previously established account connection will not be available for accounts established under the new authentication agreement.
3Reset the password to pre-4.1 style for each user, needs to use a pre-4.1 client program. This can is done using the SET PASSWORD statement and the Old_password () function:mysql> SET PASSWORD for
' Some_user ' @ ' some_host ' = Old_password (' newpwd ');
Alternatively, use Update and FLUSH privileges:mysql> update mysql.user SET Password = Old_password (' newpwd '), WH ERE Host = ' some_host ' and User = ' some_user ';
mysql> FLUSH privileges;
Substitute the password you want to use for "newpwd" in the preceding examples. MySQL cannot tell the original password is, so you'll need to pick a new one.
This is a good way to create a new account with an old-fashioned encryption protocol
4Tell the server to use the older password hashing algorithm:
Start mysqld with the--old-passwords option.
The advantages of this new authentication protocol are not available.
5Assign an Old-format password to all account for that have had its password updated to the longer 4.1 format. You can identify these accounts and the following query:mysql> SELECT Host, User, Password from Mysql.user
WHERE LENGTH (Password) > 16;
For each account record displayed by the query, use the Host and User values and assign a password using the Old_password ( function and either SET PASSWORD or UPDATE, as described earlier.
Restore has upgraded the password to the old style

http://www.bkjia.com/PHPjc/446870.html www.bkjia.com true http://www.bkjia.com/PHPjc/446870.html techarticle after MYSQL 4.1, the adoption of a new user authentication protocol, for the old client will appear does not support the authentication protocol error, the following is the official website solution;1upgrade all Clien ...

  • 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.