MySQL database forgot login password What should I do? How to modify?

Source: Internet
Author: User
Tags apache php php mysql administrator password
Now we need to set the password where there are many, there will always be confused or forget, the others do not repeat, to talk about the focus of this article, for the MySQL root password forget, how should we find it, or say How to modify the MySQL database login password? Apache PHP MySQL Here I will share with you a simple common password change method:

1. First locate and open the folder where Mysql.exe and Mysqld.exe are located (under the Bin folder of the MySQL you installed), and copy the path address. As shown

2. Open the cmd command prompt and go to the folder where the previous step Mysql.exe is located. # # # # (Here I have to run as an administrator) it's useless to open cmd directly)

3. Enter the command mysqld--skip-grant-tables enter and skip the MySQL user verification. Note After you enter this command, the command line cannot be manipulated, and you can open a new command line again. Note: Before you enter this command, end the Mysqld.exe process in Task Manager and make sure that the MySQL server end is running again.

4. Then directly enter MySQL, do not need to bring any login parameters directly to enter the database can be logged on.

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 (' root ') where user= ' root ' and host= ' localhost ', and change the password to root.

10. Check the account information again, select User,host,password from user; You can see that the password has been modified.

11. Exit the command line, restart the MySQL database, and try to log in with the new password.

MySQL Database login password modification is introduced here, now you will? With this method after the password again forget to worry about, of course, it is best to set their own often use, after all, every day to modify or quite troublesome also waste time. If there is any doubt also welcome to put forward and exchange, I wish you a happy study.

Related articles:

MySQL database administrator password forgot how to resolve

How do I change the MySQL database when I forget my password?

Related videos:

Database MySQL Video tutorial

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.