【Mysql 5.7】ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

1、通过mysql -uroot -p,输入密码登录后,必须马上修改密码,否则会报错

2、将密码修改为123456,依然报错

这和mysql 5.7的密码策略(validate_password_policy)有关,validate_password_policy可以取如下值:

默认为1即MEDIUM,包含长度、数字、英文大小写、特殊字符校验。长度由validate_password_length配置,默认为8.

3、在/etc/my.cnf配置文件中增加

4、修改密码为12345678,成功

5、查看当前密码策略

 1 mysql> show VARIABLES like "%password%"
 2     -> ;
 3 +---------------------------------------+-------+
 4 | Variable_name                         | Value |
 5 +---------------------------------------+-------+
 6 | default_password_lifetime             | 0     |
 7 | disconnect_on_expired_password        | ON    |
 8 | log_builtin_as_identified_by_password | OFF   |
 9 | mysql_native_password_proxy_users     | OFF   |
10 | old_passwords                         | 0     |
11 | report_password                       |       |
12 | sha256_password_proxy_users           | OFF   |
13 | validate_password_check_user_name     | OFF   |
14 | validate_password_dictionary_file     |       |
15 | validate_password_length              | 8     |
16 | validate_password_mixed_case_count    | 1     |
17 | validate_password_number_count        | 1     |
18 | validate_password_policy              | LOW   |
19 | validate_password_special_char_count  | 1     |
20 +---------------------------------------+-------+
21 14 rows in set (0.01 sec)
default_password_lifetime:密码过期时间(天数),0表示永不过期
validate_password_length:密码长度,默认为8
validate_password_policy:密码复杂度

原文地址:https://www.cnblogs.com/zhangxianming/p/10262194.html

时间: 2024-10-31 11:34:00

【Mysql 5.7】ERROR 1820 (HY000): 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 befo re executing this statement.

mysql> update mysql.user set password=PASSWORD('123456') where User='root';ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement. 参考:http://dev.mysql.com/doc/refman/5.6/en/alter-user.html 直接执行:set

MySQL5.7 报错 ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement

MySQL5.7 报错 : ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement 需要重新设置密码.那我们就重新设置一下密码,命令如下: set password = password('123456'); 原文地址:https://www.cnblogs.com/Dev0ps/p/11738557.html

mysql 5.7密码报错 ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

1.重新修改密码,语句如下: mysql> alter user 'root'@'localhost' identified by '123'; Query OK, 0 rows affected (0.00 sec) 2.如果修改过程出现错误(如下),转后面操作: mysql> alter user 'root'@'localhost' identified by '123'; ERROR 1819 (HY000): Your password does not satisfy the cu

mysql 报错ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executin

解决办法 1. 修改用户密码 mysql> alter user 'root'@'localhost' identified by 'youpassword'; 或者 mysql> set password=password("youpassword"); 2.刷新权限 mysql> flush privileges; 原文地址:https://www.cnblogs.com/ljl-blog/p/11540015.html

ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

  报错 在连接mysql执行语句时报错:   解决办法   执行语句: alter user 'root'@localhost identified by 'root'; 这样就可以了.

【MySQL报错】ERROR 1558 (HY000): Column count of mysql.user is wrong. Expected 43, found 39.

原文参考:http://wuzhuti.cn/2348.html 之前在centos6.4系统安装的是自带的mysql 5.1版本,后来升级到了5.6版本,执行以下命令报错 在网上查找原因说说因为升级不当导致,执行以下命令即可正常执行命令 mysql_upgrade -uroot -p123456

mysql 5.7 ERROR 1820 (HY000):

在首次登录Mysql 5.7 后,mysql数据库做出了很多的调整.执行大部分操作会提示这个错误 : ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement. 这个错误,是因为Mysql 5.7 要求更新默认密码的规则导致的.初次登录Mysql要求更新root用户密码. 可以通过以下SQL 来调整: set password=passwo

mysql 报错ERROR 1820 (HY000):You must resetpassword

今天登录mysql(Server version: 5.7.11) 还是很好的,今天登录后执行任何命令都报下面的错误 mysql> help contentsERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.mysql> help contentsERROR 1820 (HY000): You must reset your pa

【mysql】【You must reset your password using ALTER USER statement before executing this statement报错处理】

安装完mysql 之后,登陆以后,不管运行任何命令,总是提示这个 mysql> show databases; ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement. mysql> use mysql; ERROR 1820 (HY000): You must reset your password using ALTER USER