How can I solve the problem of password and Password Expiration forgotten by Mysql users?

Source: Internet
Author: User

How can I solve the problem of password and Password Expiration forgotten by Mysql users?

Forgot password:

Step 1: Now find the installation directory of MySQL and change the my-default.ini name of the installation directory to my. ini (D: \ Mysql \ mysql-5.7.13-winx64 );

Step 2: addSkip-grant-tablesAnd save (this is to remove the security check );

Step 3: restart the MySQL service;

Step 4: run the cmd command to enter the Mysql installation bin directory, enter mysql-uroot-p, and press Enter. (here is an example of account root)

Step 5: 'enter password' appears, and press Enter to Enter mysql>;

Step 6: Enter the command 'use mysql' and press enter, and then enter the SQL statement to change the password:

Update user set password = password ("new_pass") where user = "root ";

In the my. ini fileSkip-grant-tablesRemove and restart mysql.

NOTE: If MySQL5.7.13 is used, a message is displayed.ERROR 1054 (42S22): Unknown column 'Password' in 'field list'Such an error;

In this way, the SQL statement is changed:

Update user set authentication_string = password ('root') where user = 'root ';

Password expired:

Step 1: use the "Mysql forgot password method" to first access mysql;

Step 2: Change the password_expired value of the user table in the mysql database to N;

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.