MySQL connection error

Source: Internet
Author: User

1. Error messages

Message:mysqli::real_connect (): (hy000/2000): Mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Administration tool to reset your password with the command SET password = password (' Your_existing_password ‘). This would store a new, and more secure, the hash value in Mysql.user. If This user was used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from Your my.cnf file

Processing method:

The main issue is the use of high-version MySQL database import of low-version data caused by the high-version database password hashes is 41-bit hashes, and the low-version database of the data storage root password is 16-bit hashes, You need to modify the password field data of the user table to be the hashes of 41 for the specific modified command.

use MySQL;//Enter the database where the user table is stored
Set session old_passwords=0; Modify session using 41-bit hashes (16 for 1,41 0)
Select password (' 111 '); See if your password function can generate a 41-bit hashes
Set password for ' root ' @ ' localhost ' = password (' 111 '); Use the password function to modify your root password to 41 hashes

MySQL connection error

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.