MySQL 5.6的密码验证插件

运行时加载validate_password插件:

mysql> select * from information_schema.plugins where plugin_name='validate_password';
Empty set (0.05 sec)

mysql> show variables like 'validate_password%';
Empty set (0.00 sec)


安装validate_plugin插件:

mysql> install plugin validate_password soname 'validate_password.dll';
Query OK, 0 rows affected (0.00 sec)


验证validate_plugin插件安装成功:
mysql> select * from information_schema.plugins where plugin_name='validate_password'\G
*************************** 1. row ***************************
           PLUGIN_NAME: validate_password
        PLUGIN_VERSION: 1.0
         PLUGIN_STATUS: ACTIVE
           PLUGIN_TYPE: VALIDATE PASSWORD
   PLUGIN_TYPE_VERSION: 1.0
        PLUGIN_LIBRARY: validate_password.dll
PLUGIN_LIBRARY_VERSION: 1.4
         PLUGIN_AUTHOR: Oracle Corporation
    PLUGIN_DESCRIPTION: check password strength
        PLUGIN_LICENSE: GPL
           LOAD_OPTION: ON
1 row in set (0.00 sec)



查看validate_plugin插件相关的服务器变量:

mysql> show variables like 'validate_password%';
+--------------------------------------+--------+
| Variable_name                        | Value  |
+--------------------------------------+--------+
| validate_password_dictionary_file    |        |
| validate_password_length             | 8      |
| validate_password_mixed_case_count   | 1      |
| validate_password_number_count       | 1      |
| validate_password_policy             | MEDIUM |
| validate_password_special_char_count | 1      |
+--------------------------------------+--------+
6 rows in set (0.00 sec)

mysql> uninstall plugin validate_password;
Query OK, 0 rows affected (0.02 sec)

mysql> select * from information_schema.plugins where plugin_name='validate_password'\G
Empty set (0.01 sec)

mysql> 
mysql> show variables like 'validate_password%';
Empty set (0.00 sec)

mysql> notee


服务器启动时加载validate_password插件:
plugin_load = validate_password.dll
plugin_load = validate_password=validate_password.dll


指定validate_password启动参数值:
ON
OFF
FORCE_PLUS_PERMENENT


变量 说明
validate_password_dictionary_file 密码字典文件,一个密码一行,不区别大小写。在其中的密码被拒绝。
validate_password_length 密码长度
validate_password_policy 密码策略:LOW,MEDIUM,STRONG
validate_password_number_count 数字的个数
validate_password_mixed_case_count 是否大小写混合
validate_password_special_char_count 特殊字符的个数

猜你喜欢

转载自icbm.iteye.com/blog/2024955
今日推荐