Tuesday, May 5, 2020

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

Hi all,

In this post we are going to discuss the error mentioned in the post heading line....

I was trying to alter the password of an user in mysql server and the password was something like "testing", the mysql server was not allowing me to change the password as metioned rather throwing an error mentioned in the post headline.

this post will help you to overcome this situation if you follow the steps detailed below...

Keep in mind. this should not be performed where you should not be compromising security but for your local database server and other environments where security is not a high priority, then go ahead and try it out.
The environment where I have tried this has fedora as operating system and mysql 8.0.x as the database server. The procedure is more or less similar for other environments as well...

Lets talk business now...

The default password policy in mysql server is defined as given in the image below


the above details can be retrieved using the mysql command given below....

mysql> SHOW VARIABLES LIKE 'validate_password%';

In order to have a simple and plain password for any user, we should execute set of mysql commands as given below...

mysql> SET GLOBAL validate_password.policy=LOW;
mysql> SET GLOBAL validate_password.length=5;
mysql> SET GLOBAL validate_password.mixed_case_count=0;
mysql> SET GLOBAL validate_password.number_count=0;
mysql> SET GLOBAL validate_password.special_char_count=0;

the above commands are self explanatory and the execution of the above commands would change password policy settings for the current session.

After having the settings changed you can confirm the same by firing the command below...

mysql> SHOW VARIABLES LIKE 'validate_password%';

 
Now you can try the following command on the user to whom you want to change the password as something like given below...

mysql > ALTER USER 'testuser'@'localhost' IDENTIFIED BY 'testing';

this would change the password of the user.

The settings that we changed is for the current session only meaning once you have logged out or exited from the mysql server the new settings would be lost and the default settings would be retained

Well this concludes the post and hope you enjoyed it...

thanks and have a great time ahead.



No comments:

Post a Comment

Addressing Modes of 8080 / 8085 MicroProcessor

Hi,   In this post I am going to talk about different addressing modes of 8080/8085...without much talking let us get into the topic.   Ther...