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

Dung Do Tien Nov 07 2021 104

Hello guys,

I just bought a VPS server Linux Ubuntu 20.04 and I installed MySQL database on it.

After run command SHOW GLOBAL VARIABLES LIKE 'validate_password%' I got results as below:

+--------------------------------------+--------+
| 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      |
+--------------------------------------+--------+

And then I try to create a user for MySQL by using the command below:

create user 'demo'@'localhost' identified by 'demo'

And I got an exception throw "ERROR 1819 (HY000): Your password does not satisfy the current policy requirements".

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

What are current policy requirements? Anyone can explain it to me?

Thanks for any suggestions.

Have 2 answer(s) found.
  • S

    Sachin Narendran Nov 08 2021

    See this policy for creating passwords:

    +--------------------------------------+--------+
    | 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      |
    +--------------------------------------+--------+

    It's mean that:

    - Length of the password must be min from 8 characters.

    - Must contain a number

    - Must contain an uppercase character.

    - Must contain a special character

    => I think it's easy to make a password match with this policy. For example:

    create user 'demo'@'localhost' identified by 'Demo_cv9s'

    I hope it solve for you.

  • Q

    Quang Minh Hà Nov 08 2021

    You created a user with a password is "demo", It so short and does not match with the rule of your MySQL setting for password. You have 2 solutions:

    1. Set your password more strong.

    Change pass from demo to ei7veeChu4bo by using the command below:

    create user 'demo'@'localhost' identified by 'ei7veeChu4bo'

    2. Change setting password policy 

    You can run some commands below :

    mysql> SET GLOBAL validate_password_length = 4; 
    mysql> SET GLOBAL validate_password_number_count = 0; 
    mysql> SET GLOBAL validate_password.policy = LOW;
    

     note: don't forget, you need to run with root access by using the command  mysql -u root -p to grant all permission.

Leave An Answer
* NOTE: You need Login before leave an answer

* Type maximum 2000 characters.

* All comments have to wait approved before display.

* Please polite comment and respect questions and answers of others.

Popular Tips

X Close