Connect MySQL error access denied for user ' root ' @ ' localhost ' (using password:yes) workaround

Source: Internet
Author: User
Tags sql error

Tag: The database SQL error is not password-free change command line password

1. Open the My.ini file in the MySQL directory, add a line "Skip-grant-tables" (Password-free login) at the end of the file, save and close the file, and restart the MySQL service.

2. Enter the MySQL bin directory via the command line, type "Mysql-u root-p" (without entering the password) and enter the database.

3. Execute "use MySQL;", using MySQL database.

4. Change Password: Execute "update mysql.user set Authentication_string=password (' root ') where user= ' root '" (There is no password this field under the newly installed MySQL5.7 database, the password field is changed to authentication_string).

5. Open the My.ini file in the MySQL directory, delete the last line of "Skip-grant-tables", save and close the file. Restart the MySQL service and enter "Mysql-u root-p root" on the command line to successfully connect to the database.

Then login SQLyog error, error number 1862:your password has expired. Workaround access to database input via command line
mysql> SET PASSWORD = PASSWORD (' root '); Problem solving.

Connect MySQL error access denied for user ' root ' @ ' localhost ' (using password:yes) workaround

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.