MySQL database forgot login password How to retrieve and reset

Source: Internet
Author: User

1. Open the folder where Mysql.exe and Mysqld.exe are located, copy the path address (this is the machine)D:\wamp\bin\mysql\mysql5.6.17\bin

2. Open the computer cmd command prompt and go to the folder where the previous step Mysql.exe is located (CD D:\wamp\bin\mysql\mysql5.6.17\bin)
3. Enter the command mysqld--skip-grant-tables enter and skip the MySQL user verification. Do not close the cmd window, and then open a new CMD command-line window. (Note: End the "mysqld.exe" process in Task Manager before entering this command to ensure that the MySQL server end is running.) )

4. In the new run cmd command line, go directly to the CD D:\wamp\bin\mysql\mysql5.6.17\bin folder below, then enter MySQL, do not need to take any login parameters directly enter the land database can be logged.

5. Enter show databases; You can see all the database instructions successfully logged in.

6. The MySQL library is where the user name is saved.   Input use MySQL; Select MySQL database.

7.show Tables View all the tables, you will find a user table, which is stored in the username, password, permissions and so on account information.

8. Enter select User,host,password from user; To view account information.

9. Change the root password, enter update user set Password=password (' 123456 ') where user= ' root ' and host= ' localhost '; One of the 123456 passwords can be set on its own, see query ok,1 on behalf of the successful update of 1 lines, the password changes successfully
10. Close two command-line windows, restart MySQL, problem solving

MySQL database forgot login password How to retrieve and reset

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.