MySQL Password expiration issue

Source: Internet
Author: User

Sometimes when you log in to MySQL, the password expiration prompt is prompted, such as:

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/8E/E6/wKioL1jPPGnBHHRDAAAQ6eqyaJ0296.png "title=" Clipboard.png "alt=" Wkiol1jppgnbhhrdaaaq6eqyaj0296.png "/>

At this time, the client window will not be able to log on to the MySQL database server, but through the command line operation, you can log on to the MySQL database server, but through the command line to log on to the MySQL database server, can not execute any command, you need to modify the MySQL password, the following actions:

    • Enter MySQL from the command line

mysql-uroot-pwf123456

    • To execute a password change command:

SET PASSWORD = PASSWORD (' 123456 ');

Note: Use this command "Set password for [email protected] = password (' wf123456 ');" When you modify the password, the command error is prompted, the error code is "You must reset your password using ALTER USER statement before executing this statement." So change the password, try to use the above command.

    • Setting the database account has no expiration time:

ALTER USER ' root ' @ ' localhost ' PASSWORD EXPIRE never;

    • To see if the Password_expired field in the user table is Y, y, and the user has expired, n, the user has not expired.

After modifying the password of the account, the MySQL Client Connection tool will be able to reconnect to the database.


This article is from the "Why A Smile" blog, please be sure to keep this source http://helicon.blog.51cto.com/3926609/1908322

MySQL Password expiration issue

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.