How to view or modify the Root password of Mysql)

Source: Internet
Author: User

First, start the command line.

1. Run:Taskkill/f/im mysqld-nt.exe


The following operations operate some programs in the bin directory of mysql. If no environment variables are configured, switch to the bin directory of mysql and execute the following statements. Otherwise, it is invalid.

2. Continue to run in the command line:Mysqld-nt -- skip-grant-tables

3. Open a new command line to run: mysql-u root (if the bin environment variable of mysql is not configured, switch to the bin directory to execute this statement)

If you don't want to change the password, you just want to check the original password. You can execute this statement on the command line.

Select host, user, password from mysql. user; // you can view the user and password.

If you want to change the password, execute the following statement in the command line.

Update mysql. user set password = 'Enter the password you want to set here 'where user = 'root ';

Here I have set a blank password.

After completing these operations, continue to run on the command line

Taskkill/f/im mysqld-nt.exe; // security considerations, end first, because now this can be directly logged on with mysql-u root

Net start mysql; // start the mysql Service

At this point, the root password of mysql is forgotten.

I am also a cainiao. In this process, there may be some low-level problems. I hope you will give some comments. Only when I find my own faults can I make progress. I want to fly because I have inserted wings to my cainiao.

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.