Win7 system under the forgotten MySQL password how to do?

Source: Internet
Author: User
Tags ini mysql in mysql command line

1, press "Win+r" to open the "Run" window, enter "services.msc" command and press ENTER.

2. After entering the service window, select "MySQL56" in the right window and "stop" it so that the MySQL server service is stopped.

3, find MySQL in the Win7 computer installation location, you will see its folder has an INI format file, which is used to record MySQL configuration information files.

4, directly open the Command Prompt window, open the 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 another open a command line window, input command: Mysql-u root-p, enter the MySQL command line interface.

5, so you can modify the system's database, the password to update. 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 of this command represents the new password, and you can change the password yourself.

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.