Password for the root user of MySQL

Source: Internet
Author: User
Tags php and mysql

Do you forget the MySQL root Password during actual operations? Don't worry, the following article is a specific solution to this situation. We can use the following method to reset it. The following is a detailed description of the article. I hope you can learn from it.

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 the actual solution for forgetting the MySQL root password. I hope you will have some gains.

The above content is the description of the actual solution for forgetting the MySQL root password. I hope it will help you in this regard.

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.