3

I'm using MySQL 5.7.25 and i want to increase my MySQL password policy by doing this in MySQL command:

SET GLOBAL validate_password_policy=2;

But i always get an error:

ERROR 1193 (HY000): Unknown system variable 'validate_password_policy'

I tried to list the validate_password variable:

SHOW VARIABLES LIKE 'validate_password%'

but it always return empty set

blue
  • 1,285
  • 2
  • 7
  • 15

3 Answers3

9

This problem has happened because validate_password plugin is by default NOT activated. You can solve by these commands:

mysql> select plugin_name, plugin_status from information_schema.plugins where plugin_name like 'validate%';

Empty set (0.00 sec)

mysql> install plugin validate_password soname 'validate_password.so';

Query OK, 0 rows affected (0.02 sec)

mysql> select plugin_name, plugin_status from information_schema.plugins where plugin_name like 'validate%';

Finally, you will show the following:

+-------------------+---------------+
| plugin_name       | plugin_status |
+-------------------+---------------+
| validate_password | ACTIVE        |
+-------------------+---------------+
1 row in set (0.00 sec)

Then you can run your command:

mysql> SHOW VARIABLES LIKE 'validate_password%';

+--------------------------------------+--------+
| Variable_name                        | Value  |
+--------------------------------------+--------+
| validate_password_check_user_name    | OFF    |
| 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      |
+--------------------------------------+--------+
7 rows in set (0.00 sec). 
3

This command works for me. I'm using MySQL 8.

SET GLOBAL validate_password.policy=LOW;
Duy Nguyen
  • 131
  • 1
  • 6
  • Command work, but then trying change password i get: "Failed! Error: Your password does not satisfy the current policy requirements" – xayer Feb 01 '20 at 00:40
0

SET GLOBAL validate_password_policy=LOW;

Replace validate_password(dot)policy with validate_password_policy

enter image description here