Reset the root user password for MySQL (Window)

Source: Internet
Author: User

1, first to stop the MySQL service. Open cmd, type command

net stop MySQL

The default MySQL service name is MySQL, if you have modified the service name, please modify the command in your own control.

2, in the cmd into the MySQL bin directory, for example, my is C:\mysql\bin, type command

Mysqld-nt--skip-grant-tables

This command is used to skip the MySQL permission check table, and if the command succeeds, the CMD window will be found to be stuck.

3. Reopen a CMD window and enter the MySQL bin directory again, type the command

Mysql-u Root

You will be logged in as root and you can see that the command prompt changes to mysql>.

4, change the root password. Type the command in turn

Use MySQL

Update user set Password=password ("New password") where user= "root";

Flush privileges;

Exit

The function is to enter MySQL library, change the root password, update the MySQL permission table, exit.

5. Use Ctrl-alt-del to bring up the Task Manager and terminate the Mysqld-nt.exe process.

6. Use the command under CMD

net start MySQL

Restart the MySQL service.

Article Slyar Article source: Slyar Home (www.slyar.com).

Reset the root user password for MySQL (Window)

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.