How to reset the root user password of a MySQL database

Source: Internet
Author: User

I first introduce the environment I use:

1. Windows;

2. php Service Manager wamp5;

Let's talk about the following:

1. Open the task manager and end the process mysqld-nt.exe

2. Run Command window

1). Run the "bin" directory in the PHP Service Manager installation directory (my directory is "D: \ Wamp \ mysql \ bin ),

Operation:

(1) Enter disk D, for example, D: Press enter;

(2) enter the bin directory, for example, CD Wamp \ mysql \ bin. Press enter;

(3) skip the permission check to start MySQLFor example, mysqld-NT -- skip-grant-tables; press ENTER

(4) At this time, the cursor can only Flash and cannot be operated, that is, it is a huge step of success;

For example:

2) open another command window:

Operation:

(1) run the following command in the bin directory of the PHP Service Manager installation directory:

Enter disk D, for example, D: Press enter;

Enter the bin directory, for example, CD Wamp \ mysql \ bin. Press enter;

(2) enter the use data table and enter the command, for example, use MySQL press Enter;

(3) start to set the password, for example, update user SET Password = PASSWORD ("123456") where user = "root"; press ENTER

(4) perform the so-called refresh such as flush privileges; press ENTER

(5) Exit, such as: exit; press enter OK;

Note: (6), when the database has not started, with tricks (open the task manager, stop the process mysqld-nt.exe and then restart; absolutely OK !)

For example:

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.