How to retrieve the root password of mysql

Source: Internet
Author: User

Share an article about the common problems that people may encounter, that is, they suddenly do not remember the root password of the mysql server, and some friends directly reinstall the system. This is also a solution, however, we provide a more convenient way to retrieve the mysql root Password.

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: wampmysqlbin ),

Operation:

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

(2) enter the bin directory, for example, cd wampmysqlbin. Press enter;

(3) skip the permission check and start MySQL, for 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;

 

 

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 wampmysqlbin. 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 !)

 

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.