Ctfrancia
Ctfrancia

Reputation: 1588

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

there are many posts out there about resolving this issue, however, none of them work for me. I am signed in as root on MySQL within my computer. after signing in with $ mysql -u root -p and enter my password I enter in and try to create a user with CREATE USER 'test'@'localhost'; but then I get the error:

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

after printing my variables with SHOW VARIABLES LIKE 'validate_password%'; I get:

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

I have tried with this solution as well as this, however, when trying uninstall the validate password with: UNINSTALL plugin validate_password; I get:

ERROR 1305 (42000): PLUGIN validate_password does not exist

whenever I try to set a variable I get the error:

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

in between the quotation marks above can be replaced with any variable. I am correctly signed in as root. and just starting to lose my mind over this.

thank you for your help.

Edits:

I have tried to find my my.cnf file followingthis comment and while I have found it any editing to the file causes a socket error:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I have also tried uninstalling and reinstally MySQL through homebrew however the error continues with the policy requirements.

Upvotes: 1

Views: 12189

Answers (2)

Md.Habibur Rahman
Md.Habibur Rahman

Reputation: 351

after trying with some simple passwords, I got this error, then checked the variables table with this SHOW VARIABLES LIKE 'validate_password%'; enter image description here

the output shows that the policy is already set to low, then what I did is just followed what is mentioned here to build the password, which is like, using at least 8 chars, 1 number at least, mixing of case letters etc. After that performed the command 'ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'mysql0_rT'; and then there was no error.

Upvotes: 0

Ctfrancia
Ctfrancia

Reputation: 1588

So the error was that I cannot create a user without a password: mysql> CREATE USER 'test'@'localhost'; this will fail because I cannot create a user without stating the password, even if I will assign it later I need to create and set the password.

So:

mysql> CREATE USER 'test'@'localhost' IDENTIFIED BY 'Password1';

Password1 should be replaced with your desired password.

Upvotes: 2

Related Questions