Modify the root password of MySQL under Windows environment

Source: Internet
Author: User

Recently has been useless mysql,root password to forget, and then I modified it, and now tidy up the steps. (my version is 5.1)

1. First get the MySQL bin path, copy it down.

Right-click and select Properties.

2. Open the Command Window "CMD" and switch the path to the MySQL path just copied;

>>CD C:\Program files\mysql\mysql Server 5.1\bin

Close the SQL service;

>>net stop MySQL

Then enter: >> mysqld--skip-grant-tables

3. At this point, you should open another command window, the same switch to the MySQL path;

Input: >>mysql-uroot-p Press 2 times to enter;

Then, modify the password:>> update mysql.user set Password=password ('123456') where user= ' root ';

(123456) It's your new password.

Finally enter flush privileges; Will remind SQL to refresh the system permissions, the password will take effect.

OK, the root password has been modified.

Modify the root password of MySQL under Windows environment

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.