How to forget the MySQL root Password in Windows

Source: Internet
Author: User

How to forget the MySQL root Password in Windows

1. Open the MySQL configuration file my. ini and add skip-grant-tables to the end of the file or add it to the [mysqld.

2. Restart the MYSQL service.

In windows:
Net stop MySQL
Net start MySQL

If an invalid command is displayed, pay attention to the environment variable configuration.

3. Set the ROOT password

Output on the command

Select a database and use mysql.

Run the following statement to update the root password to 123456:
Update user set password = PASSWORD ("123456") where user = 'root ';

Quit exit MySQL

4. Restore the configuration file and restart

Delete the above "skip-grant-tables" and restart the service.

This article permanently updates the link address:

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.