Selasa, 05 Maret 2019

How do I turn off the mysql passowrd validation or Your Password does not Satisfy the Current Policy Requirements


Whenever the user tried to set any password in MySQL, he faced following error:

mysql> create user 'testuser'@'localhost' identified by 'password';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

After a while, he really got frustrated by this Current Policy Requirements for a password.
You can check the current variables related to validating password by running the following command:

mysql> show global variables like 'validate%';
+---------------------------------------+-------------+
| Variable_name                         | Value       |
+---------------------------------------+-------------+
| validate_password.check_user_name     | ON          |
| 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.01 sec)

Now let us see how we can resolve our error.

Method 1: Let us see how we can set the password_policy to low login to mysql as root:

mysql> SET GLOBAL validate_password.policy=LOW;
mysql> SET GLOBAL validate_password.length=6;

Method 2: You can also set the same variable in my.cnf file as well edit my.cnd like this.

[mysqld]
validate_password.policy=LOW
validate_password.length=6

Method 3: Uninstall Plugin which validates password if you use MySQL Ver 5.7 below
Run the following sql command:

mysql> uninstall plugin validate_password;

Tidak ada komentar: