What should I do if I forget the mysql password?

Source: Internet
Author: User

What should I do if I forget the mysql password?

Two times I forgot my mysql password? At first, I did the most silly thing and uninstalled the reinstallation.

Now there is a way to set the password back without uninstalling it. The knowledge comes from the internet. I will try it out here. If you have the same friends, try it.

The implementation is completed on windows.

Step 1

Find mysqld.exe in the task manager and end the process.

Step 2

Find the bin directory under the mysql installation directory, my C: \ Program Files \ MySQL \ mysql-5.6.24 \ bin

Open the console in this directory and enter mysqld -- skip-grant-tables.

Step 3

Switch to the current path and open a new controller.

1) input: mysql

2) input: show databases;

3) input: use mysql

4) input: show tables;

The user table is displayed.

Input: select user, password, host from user; to view the content in the table.

Now we can modify the data in the table through update.

Input: update user set password = passwrod ("123456") where user = "root" and host = "localhost ";


Since then, the mysql password has been changed.

The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.

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.