How to modify MySQL password under Windows

Source: Internet
Author: User
Tags safe mode

How to retrieve the super user MySQL database password under DOS, the actual operation under Windows is as follows 1. Close the running MySQL;

CMD Open DOS window input net stop MySQL or into service end MySQL run 2. Open the DOS window and go to the Mysql\bin directory; 3. Enter Mysqld-nt--skip-grant-tables.   If the message doesn't appear, it's right.   4. Open a DOS window again (because the DOS window is no longer moving), go to the Mysql\bin directory. 5. Go to MySQL Safe mode, that is, when MySQL gets up, you can enter the database command without entering the password:

Mysql-uroot-p log in to MySQL using a blank password 6. Password: > Update mysql.user set Password=password ("123456") where user= "root";   (Don't forget the last semicolon)   7. Refresh permissions (required steps) >flush privileges; 8. Exit > \quit

9. Log out of the system, then enter, open MySQL, use the username root and just set the new password 123456 to login.

B Modify the account password with Mysqladmin

DOS under the Bin folder of MySQL, if you configure the environment variable is not necessary

mysqladmin-uroot-p Old password Password new password (note a space before the new password)

How to modify MySQL password under Windows

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.