Forgot the MySQL root password reset method

Source: Internet
Author: User

If you forget the MySQL root password, you can reset it in the following ways:

1. Kill off the MySQL process in the system;

2. Use the following command to start MySQL, to do not check the permissions of the way to start;

Mysqld_safe-skip-grant-tables &

3. Then use the null password method to log in to MySQL with root user;

Mysql-u Root

4. Change the password of root user;

mysql> Update Mysql.user Set Password=password (' New password ') where user= ' root ';

mysql> flush Privileges;

Mysql> quit

5. Restart MySQL, you can log in with the new password.

The above is the use of SQL commands to implement, in fact, we can also change the user password by replacing the MySQL using performance is similar to, I used to (under the same version of MySQL did replace MySQL database this practice, if the database inside the database is different do not operate).

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.