zoukankan      html  css  js  c++  java
  • You must reset your password using ALTER USER statement before executing this statement

    如果MySQL数据库用户的密码设置过于简单,数据库在用户登录后会提示重置密码,并且不接受简单的密码。
    提示需要重置密码:
    ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
    Mysql数据库版本:5.7.1
    操作系统:CentOS 7
    这个问题是否奇怪,因为明明是刚刚用密码登录了mysql服务器。怎么要重置密码呢?因为密码太简单了,不符合MySQL的安全要求。
    参考官方的文档,见http://dev.mysql.com/doc/refman/5.6/en/alter-user.html。重置用户密码操作:
    mysql> SET PASSWORD = PASSWORD('123456');   //123456 是重置的新密码
    以上操作后又遇到新问题:
    ERROR 1819 (HY000): Your password does NOT satisfy the CURRENT policy requirements。
    又参考了官方文档,见http://dev.mysql.com/doc/refman/5.7/en/validate-password-plugin.html。
    应该是密码过于简单了。 后来用大写字母+数字+特殊字符混合了一个密码。重置密码成功!
    以后操作,没有再出现上述问题。


    注意:如果只想设置简单密码需要修改两个全局参数:
    mysql> set global validate_password_policy=0;
    mysql> set global validate_password_length=1;

    Grant all privileges on *.* to 'root'@'%' identified by '123456!' with grant option;

  • 相关阅读:
    Codeforces 1132D
    Codeforces 670F
    Codeforces 670E
    Codeforces 670E
    Codeforces 670E
    Codeforces 670
    Codeforces 1138
    Codeforces 1114E
    力扣21.合并两个有序链表
    力扣538.把二叉树转换为累加树
  • 原文地址:https://www.cnblogs.com/wangmo/p/9007901.html
Copyright © 2011-2022 走看看