mysql5.6 forgot root password

Source: Internet
Author: User

1, first net stop MySQL service, and switch to Task Manager, there is MySQL-related, it is best to close the process.

2, run the cmd command to switch to the MySQL installation bin directory, the following is my MySQL installation directory

CD D:\Program files\mysql\mysql Server 5.6\bin

Then execute the mysqld--skip-grant-tables (note that there is no semicolon behind it;)

The following message appears,

This command-line window does not close and then reopen a new command-line window. Note that there is sometimes a warning to ignore.

3. Open a new CMD window again. According to the above method to run to the bin directory, run the command: Mysql-u root-p, prompted to enter the password, direct return,

Such as

4. Execute command: Update mysql.user set Password=password (' root ') where user= ' root ';

The root user password is then set to root

5. Refresh execution: mysql> flush privileges;

Now you can log in again, the password changes successfully.

mysql5.6 forgot root password

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.