MySQL error 1045

Source: Internet
Author: User

Run "net stop MySQL" in cmd to stop the MySQL service.

Then, add skip_grant_tables (add this sentence) under [mysqld] In the my. ini file, and then start the MySQL service.

Switch the directory to your MySQL installation path in cmd, for example, D: \ mysql5 \ bin.

Therefore, enter cd d: \ mysql5 \ bin in cmd.

Input mysql-uroot-P again, then cmd will switch to MySQL Mode

In MySQL, enter

Update user SET Password = PASSWORD ('newpassword') where user = 'root'

Now, your root password has been changed to newpassword.

Delete the skip_grant_tables added to my. ini.

Restart the MySQL service. Net start mysql. Everything is done ~~~

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.