How To Change MySQL Password Policy Level

In this post, I will guide you on How To Change MySQL Password Policy Level. MySQL updated the password strength check feature and improved security, but this makes it difficult to use.

The latest MySQL servers come with a password validation plugin. This plugin is validate_password, it will check password strength to improve security for MySQL server.

So when you change your password and your password doesn’t respond to the validation_password’s set you will get the error:

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

Steps To Change MySQL Password Policy Level

First, log in to MySQL as root or another user with privileges.

mysql -u root -p

Execute query to see current setting of “validate_password” using below command:

SHOW VARIABLES LIKE 'validate_password%';

You can see the output like this:

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.01 sec)

The default level of the password policy is MEDIUM.

We need to change it to LOW by using the below query:

SET GLOBAL validate_password_policy=LOW;

Output:

mysql> SET GLOBAL validate_password_policy=LOW;
Query OK, 0 rows affected (0.02 sec)

The LOW level required only the password length to min 8 characters, it will not check for uppercase, numbers, or special characters.

To make this setting, edit MySQL configuration (my.cnf) file:

[mysqld]
validate_password_policy=LOW

Restart MySQL service to take a change.

Follow us for the more helpful posts!

We hope this is a useful post for you.

You can read more useful posts like How To Add Terms And Conditions Checkbox In Magento 2.

Thank you for reading!

4.8 4 votes
Article Rating

Aaron LX

Aaron is a passionate writer, crazy about shopping, eCommerce and trends. Besides his outstanding research skills and a positive mind, Aaron eagerly shares his experience with the readers.

Leave a Reply or put your Question here

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
bogdanchirilais
bogdanchirilais
January 10, 2023 1:42 pm

Hello,

you need to change from this :

SET GLOBAL validate_password_policy=LOW;

to this :

SET GLOBAL validate_password.policy=LOW;

1
0
Would love your thoughts, please comment.x
()
x