MySQL:Yourpassworddoesnotsatisfythecurrentpolicyrequirements

环境:

  1. MySQL> select version();
  2. +------------+
  3. | version() |
  4. +------------+
  5. | 5.7.17-log |
  6. +------------+
  7. 1 row in set (0.00 sec)
报错:

  1. mysql> create user repl@'192.168.100.51' identified by '123456';
  2. ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
出现这个问题是因为安装了插件,如下:

  1. mysql> select name,dl from mysql.plugin;
  2. +-------------------+----------------------+
  3. | name | dl |
  4. +-------------------+----------------------+
  5. | validate_password | validate_password.so |
  6. +-------------------+----------------------+
  7. 1 row in set (0.00 sec)
具体规则是:

  1. mysql> SHOW VARIABLES LIKE 'validate_password%';
  2. +--------------------------------------+--------+
  3. | Variable_name | Value |
  4. +--------------------------------------+--------+
  5. | validate_password_check_user_name | OFF |
  6. | validate_password_dictionary_file | |
  7. | validate_password_length | 8 |
  8. | validate_password_mixed_case_count | 1 |
  9. | validate_password_number_count | 1 |
  10. | validate_password_policy | MEDIUM |
  11. | validate_password_special_char_count | 1 |
  12. +--------------------------------------+--------+

插件的安装启用:
1.插件对应的库对象文件需在配置选项plugin_dir指定的目录中。
2.可使用--plugin-load=validate_password.so在server启动时载入插件,或者将plugin-load=validate_password.so写入配置文件。
3.也可以通过如下语句在server运行时载入插件(会注册进mysql.plugins表)mysql> INSTALL PLUGIN validate_password SONAME 'validate_password.so';

为阻止该插件在运行时被删除可在配置文件中添加:
[mysqld]
plugin-load=validate_password.so
validate-password=FORCE_PLUS_PERMANENT

更多信息:

https://dev.mysql.com/doc/refman/5.7/en/validate-password-plugin-installation.html

网页题目:MySQL:Yourpassworddoesnotsatisfythecurrentpolicyrequirements
文章URL:http://azwzsj.com/article/pocsch.html