What should I do if I forget my Mysql password under Win7 system?

  

1. Press ““Win+R” to open the “Run” window and enter the “services.msc” option and press Enter.

2. After entering the service window, select “MySQL56” in the right window and stop it “ so that the MySQL Server service stops.

3, find the installation location of MySQL in the win7 computer, you will see a file in the folder in the ini format, this file is used to record the configuration information of MySQL.

4, directly open the command prompt window, open a command line window, enter the following command: C:Userswang> mysqld --defaults-file="D:Program FilesMySQLMySQL Server 5.6my-default.ini" --console --skip-grant-tables, after that, open another command line window, enter the command: mysql -u root -p, press Enter to enter the mysql command line interface.

5, this way you can modify the system's database and update the password. The commands you need to use here are:

mysql->show database;

mysql->use mysql

mysql->update user set password=PASSWORD( 12345) where USER=root;

The 12345 in this command represents the newly set password. You can change this password yourself.

Copyright © Windows knowledge All Rights Reserved