MySQL database modify root password method

Source: Internet
Author: User

How to modify the MySQL Super Administrator root password under window

1 Stop Service

Start-and-run input cmd, open a command Prompt window, and then enter net Stopmysql to stop MySQL-related services


2 in the Command Prompt window, go to the bin directory of the MySQL installation directory

If the other disk, please switch to another disk such as input D: Enter, and then enter the CD file path for example

CD D:\wamp\bin\mysql\mysql5.5.20\bin can be accessed under this folder


3 Enter MySQL security mode (so that you do not need to enter a password to enter the MySQL database)

Input Mysqld--skip-grant-tables, at this time the screen does not react, no tube, put it on OK


4 Open a new command window, enter mysql-uroot-p directly, prompt for password, do not need to enter, directly enter the can, and then go to the MySQL database


5 Enter the following command to modify the root user password

Update Mysql.user set Password=password (' 000000 ') whereuser= ' root ';

Mysql.user: Remember that there is a "." for the user table.

000000: That is the new password


6, Refresh the Permissions table, enter the following command flush privileges;


7, exit, enter the following command quit


8 Restarting the MySQL service is OK.


MySQL database modify root password method

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.