MySQL database password forgot to retrieve the method

Source: Internet
Author: User
Keywords Web programming MySQL Tutorial
Tags check database password directory installation installation directory login mysql mysql database

1. Login system with system administrator.
2. Stop the MySQL tutorial service.
3. Enter the command window, and then enter the MySQL installation directory, such as my installation directory is c:mysql, into the C:mysqlbin
4. Skip permission Check to start MySQL,
C:mysqlbin>mysqld-nt--skip-grant-tables
5. Reopen a window, enter the C:mysqlbin directory, set the new password for root
C:mysqlbin>mysqladmin-u root flush-privileges password "NewPassword"
C:mysqlbin>mysqladmin-u root-p shutdown
Replace the newpassword with the root password you want to use, and the second command prompts you to enter a new password and repeat the password entered in the first command.
6. Stop MySQL server, start MySQL in normal mode
7. You can link to MySQL with a new password.

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.