[MySQL] Notes

1、连接error:Your password has expired.To log in you must change it using a client that suppor。

The problem

After version 5.7, Mysql changed the default mandatory password update policy. This error may occur when the client connects to Mysql.

solution

  1. The cmd command pops up a command window, enter mysql -uroot -p to start, and enter the previous password to log in to mysql;
  2. If you want to change the password, you can use:
    set password=password('password');
    
    The new password is in brackets. If you don't need to modify it, you can skip this step.
  3. Set the validity period of the police password; there are multiple names for selection, you can choose according to the situation:
    /*设置有效期为90天*/
    ALTER USER 'root'@'localhost' PASSWORD EXPIRE 90 DAYS;
    
    /* 不验证有效期 */
    ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;
    
    /* 设置为默认值 */
    ALTER USER 'root'@'localhost' PASSWORD EXPIRE DEFAULT;
    

pending upgrade……

Guess you like

Origin blog.csdn.net/weixin_40849588/article/details/100124984