MySQL:Your password does not satisfy the current policy requirements

甲骨文技術支援發表於2017-02-23
環境:

  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

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/20893244/viewspace-2134180/,如需轉載,請註明出處,否則將追究法律責任。

相關文章