Cómo solucionar el error de requerimientos sobre el password en MySQL

Author
By Darío Rivera
Posted On in MySQL

After the installation of MySQL, we generally use the mysql_secure_installation command to configure the root user's password, remove test databases and users, and configure password policy. If you configured the password policy to MEDIUM or higher, it is likely that you will get an error like the following when attempting to create a user:

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

For this, you have the option of creating a stronger password. However, many times we are in a development environment and we do not really care much about this policy and want to use easy-to-remember passwords and configure them in our applications. The first thing you should do is to verify the level of the password policy by executing the following command in the mysql console.

SHOW VARIABLES LIKE 'validate_password%';

You will get a result similar to the following:

+--------------------------------------+--------+
| 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.04 sec)

In this case, the policy is configured to MEDIUM. To change this, simply change the value of the respective global variable and set it to LOW.

SET GLOBAL validate_password.policy=LOW;

You can make this configuration permanent by adding it to the mysql configuration file. This file is usually called my.cfn (Unix) or default.cfn (Windows). The location of this file depends a lot on how mysql was installed and on what operating system. Simply add this variable with its respective value.

[mysqld]
validate_password.policy=LOW

Acerca de Darío Rivera

Author

Application Architect at Elentra Corp . Quality developer and passionate learner with 10+ years of experience in web technologies. Creator of EasyHttp , an standard way to consume HTTP Clients.

LinkedIn Twitter Instagram

Sólo aquellos que han alcanzado el éxito saben que siempre estuvo a un paso del momento en que pensaron renunciar.