How can I reset the MySQL root password after I forget it?

Source: Internet
Author: User

In practice, if you forget the MySQL root Password, don't worry. You can use the following method to reset it, if you are interested in the actual operations related to Resetting the MySQL root Password, you can click to view the following articles.

1. KILL the MySQL (the best combination with PHP) process in the system;

2. Run the following command to start MySQL (the best combination with PHP) without checking the permissions;

MySQL (best combination with PHP) d_safe-skip-grant-tables &

3. Then use the empty password to log on to MySQL as the root user (the best combination with PHP );

MySQL (best combination with PHP)-u root

4. Modify the password of the root user;

MySQL (the best combination with PHP)> update MySQL (the best combination with PHP ). user set password = PASSWORD 'new password') where User = 'root'; MySQL (the best combination with PHP)> flush privileges; MySQL (the best combination with PHP)> quit

5. Restart MySQL (the best combination of PHP and MySQL) to log on with the new password.

The above content is an introduction to forgetting the MySQL root password. I hope you will get something better.
 

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.