Forget the MySQL root Password. Don't worry

Source: Internet
Author: User

This article mainly describes how to solve the problem of forgetting the MySQL root password on the Windows server, we all know that in practice, if you forget your MySQL root Password, It is a headache. The following article will solve this problem.

Subbranch cmd to MySQL bin directory

 
 
  1. bin>MySQLd-nt.exe --skip-grant-tables &  

Open new command window

 
 
  1. Bin> MySQL-u root
  2. MySQL> update MySQL. user set password = PASSWORD ('new password') where User = 'root ';
  3. MySQL> flush privileges;
  4. MySQL> quit

1. Specify the directory in the command to the bin directory under MySQL, enter the command: MySQLd-nt.exe -- skip-grant-tables &

This operation aims to skip the permission Checklist

2. Enter the command: MySQL-u root in the command line.

The purpose of this operation is to log on with the MySQL root Password. After Successful Logon, the information indicating successful logon is displayed, and you can proceed to the next step.

3. Enter the command in the command line: update MySQL. user set password = PASSWORD ('new password') where User = 'root ';

This operation aims to change the password of the root user.

4. Enter flush privileges in the command line;

This operation aims to update the MySQL permission table.

 

The above content describes the solution to forgetting the MySQL root Password under the win server, hoping to help you in this regard.

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.