MySql database prompt: 1045 access denied for user & #39; root & #39; @ & #39; localhost & #39; using password YES, mysqldenied

Source: Internet
Author: User

MySql database prompt: 1045 access denied for user 'root' @ 'localhost' using password YES, mysqldenied

1. Start --> cmd --> net stop mysql (it can be omitted if the MySQL service is disabled but not started)

2. Find my. ini in the installation path MySQL Server 5.1.

3. Open my. ini, find [mysqld], and add

Skip_grant_tables (it seems that the permission table authentication is skipped when the MySQL service is started)

4. Start the database and change the password.

Start --> cmd --> net start mysql (start MySQL Service) ---> mysql press enter (if successful, a MySQL prompt will appear)

5. Enter use mysql; (connect to the permission database ).

6. change password: update user set password = password ("123") where user = "root"; (do not forget the last plus points, before version 5.7, replace the password field with authentication_string after version 5.7)

7. Refresh permission (required): flush privileges ;.

8. Exit quit.

9. Remove skip_grant_tables from step 1 in my. ini (the permission table authentication cannot be skipped when the MySQL service is started)

10. Restart MySQL and enter again. You can log on with the username root and the new password 123 you just set.

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.