MySQL password forgot to solve the method

Source: Internet
Author: User

1, first kill mysqld-nt.exe process, there are many ways, the simplest is to enter the CMD in the net stop MySQL

2. CMD path switch to the bin in the MySQL installation directory

Input Mysqld-nt.exe--skip-grant-tables Enter, this window is not off!!

3, another open cmd, still switch to the bin directory

Enter the following command at a time

Mysql

> Use MySQL

> Update user Set password = "NewPassword" WHERE user = "* * *"

> Flush Privileges

> Exit

Turn off the above two windows and enter the net start MySQL in cmd (start MySQL service)

You'll be able to enter the database with your new password.

People may think it's OK to set it up like above, but that's not true.

When you restart your computer, the problem is still the same. You have to get it back again.

In fact, the steps described above, after you finish the second step, the following will not have to do, the password change is a sample, even without the password can be into the database.

You also need to make the following settings (key steps)

From start-"All Programs enter" MySQL Server Instance Config Wizard "

Always point "next", some places can be default, but there is a place to change, is the default character changed to "gb2312", the next step is to change the password place, the original password is empty, set the new password, next after execute. OK, so you connect to the database, the original password is no longer available.

This solves the problem completely!

MySQL password forgot to solve the method

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.