MySQL5.1 how to forget the root password

Source: Internet
Author: User

The password is incorrect when I log on to MySQL Query Browser today. It is strange that I always use a blank password or a specific password.

Failed to try multiple times! No matter what the problem is, just forget the password.

Create pwdhf.txt in the installation directory of MySQL, and enter the text: set password for 'root' @ 'localhost' = PASSWORD ('*****');

The red part shows the new password to be set.

Use windows service management tools or task manager to stop the MySQL service (task manager K drops the mysqld-nt process)

Doscommand prompt to the bin directory under the MySQL installation directory, for example, my directory is D: \ Program Files \ MySQL Server 5.1 \ bin

Then run: mysqld-nt -- init-file = ../pwdhf.txt

After the execution is complete, stop the MySQL database service (Job Manager K drops the mysqld-nt process), and then start MYSQL again in normal mode.

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.