Troubleshooting MySQL Database tip: 1045 Access denied for user ' root ' @ ' localhost ' using password Yes

Source: Internet
Author: User

Today want to use MySQL database who knows the old tips

1045 Access denied for user ' root ' @ ' localhost ' using password Yes

Finally found the answer on the csdn.

Source: http://bbs.csdn.NET/topics/310006640 13 Floor

Solve:

1. Start-up cmd-to-net stop MySQL (disable MySQL service does not start can be omitted)

2. Locate the installation path under MySQL Server 5.1 My.ini

3. Open My.ini to find [mysqld] and add the following

This sentence: Skip_grant_tables (meaning as if the MySQL service is starting to skip permission table authentication)

4. Then start the database and change the password.

Start-up, cmd-to-net start MySQL (start MySQL service)---> mysql enter (MySQL prompt will appear if successful)

5. Enter use MySQL; (Connection rights database).

6. Change Password: Update user set Password=password ("123") where user= "root"; (don't forget the last semicolon).

7. Refresh permissions (required steps): flush privileges;.

8. Quit quit.

9. Remove the skip_grant_tables from the My.ini in the 3rd step (do not let him skip the authorization form when starting the MySQL service)

10. Restart MySQL, then enter, use the user name root and the new password just set 123 can log in.

Troubleshooting MySQL Database tip: 1045 Access denied for user ' root ' @ ' localhost ' using password Yes

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.