Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mySQL password policy refuses all attempts to create user

My current installation of mySQL/phpMyAdmin on my ubuntu server is refusing to allow any user to be created with any password I have tried. The error is always:

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

I have never had this error before with other installations of mysql, on server and xampp/localhost both. This is a new server installation however.

For example, on the mysql terminal on the command line, any attempt to create a user (with extremely random passwords) fails

mysql> CREATE USER 'ses'@'%' IDENTIFIED BY 'yIO8v3hVai0zosaD';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql> CREATE USER 'ses'@'%' IDENTIFIED BY 'yIO8v3hVai0zosaDyIO8v3hVai0zosaDyIO8v3hVai0zosaD';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

Same thing with phpMyAdmin

enter image description here

enter image description here

With the following error at the bottom

Warning in ./libraries/dbi/DBIMysqli.class.php#261
 mysqli_query(): (HY000/1819): Your password does not satisfy the current policy requirements

Backtrace

./libraries/dbi/DBIMysqli.class.php#261: mysqli_query(
object,
string 'SELECT PASSWORD(\'rSxYcnCcO2fhhKgD\') AS `password`;',
integer 0,
)
./libraries/DatabaseInterface.class.php#244: PMA_DBI_Mysqli->realQuery(
string 'SELECT PASSWORD(\'rSxYcnCcO2fhhKgD\') AS `password`;',
object,
integer 1,
)
./libraries/DatabaseInterface.class.php#1944: PMA_DatabaseInterface->tryQuery(
string 'SELECT PASSWORD(\'rSxYcnCcO2fhhKgD\') AS `password`;',
object,
integer 1,
boolean false,
)
./libraries/server_privileges.lib.php#5055: PMA_DatabaseInterface->fetchSingleRow(string 'SELECT PASSWORD(\'rSxYcnCcO2fhhKgD\') AS `password`;')
./libraries/server_privileges.lib.php#5179: PMA_getHashedPassword(string 'rSxYcnCcO2fhhKgD')
./libraries/server_privileges.lib.php#4176: PMA_getSqlQueriesForDisplayAndAddUser(
string 'test-accountdb',
string '%',
string '',
)
./server_privileges.php#167: PMA_addUser(
NULL,
string 'test-accountdb',
string '%',
NULL,
boolean true,
)

Edit: Added results for the mysql validate_password% variables

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      |
+--------------------------------------+--------+
like image 544
element11 Avatar asked Jul 07 '16 22:07

element11


People also ask

What is the password policy for MySQL?

By default, the MEDIUM policy specifies that passwords must be at least 8 characters long, contain at least 1 numeric character, 1 lowercase character, 1 uppercase character, and 1 special (nonalphanumeric) character.

How do I change my password policy in MySQL?

First, log in to MySQL as root or another user with privileges. The default level of the password policy is MEDIUM. The LOW level required only the password length to min 8 characters, it will not check for uppercase, numbers, or special characters. Restart MySQL service to take a change.

Can a MySQL user have multiple passwords?

As of MySQL 8.0. 14, user accounts are permitted to have dual passwords, designated as primary and secondary passwords.

What is MySQL Default_password password?

The default user for MySQL is root and by default it has no password. If you set a password for MySQL and you can't recall it, you can always reset it and choose another one.


2 Answers

This is the Validate Password Plugin at work. It was introduced in MySQL 5.6.6.

According to the values returned from the SHOW VARIABLES LIKE 'validate_password%'; you're missing a single special character in your password as indicated by validate_password_special_char_count | 1.

Add a special character such as $ or * to this password yIO8v3hVai0zosaD you'll be able to create the user.

like image 55
Michael Hommé Avatar answered Oct 05 '22 13:10

Michael Hommé


Procedure 1:

Step1: Log in with root user ane and password

Step2: run bellow command in Sql terminal

 uninstall plugin validate_password 

Step3 : create a new user with whatever password you want

Step4: run bellow command in Sql terminal

INSTALL PLUGIN validate_password SONAME 'validate_password.so';

Step5: Checkout now your username & password by login

Procedure 2:

Add a special character such as $ or * to this password icluding other cases like digit,small case character, uper case character

like image 36
ipsm Avatar answered Oct 05 '22 14:10

ipsm