Mysqlroot password hack under Windows

Source: Internet
Author: User

Win several ways to change the root password under MySQL # #win2003mysql password hack

Method 1: Use the Set password command

Mysql-u Root

mysql> SET PASSWORD for ' root ' @ ' localhost ' = PASSWORD (' Newpass ');

Method 2: In the case of forgetting the MySQL password

1. First turn off the MySQL service

2. Use cmd to enter the MySQL installation directory under the bin input mysqld--skip-grant-tables enter MySQL Safe Mode # Here's msqld–skip-grant-tables is mysql5.5 version and one is MYSQ Ld-nt–skip-grant-tables versions are different, the commands that go in are different. 2 commands test it.

2. Re-open a CMD command-line window directly enter mysql–uroot–p directly press ENTER to go in this time no password is required 3. Change the root password

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

4. Reload Permissions

Mysql>flush Privileges

5. Ending the Mysqd.exe process

6. Turn on MySQL service

This allows you to enter MySQL by entering a new password in the bin directory of MySQL.

Mysqlroot password hack under Windows

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.