If you are facing such an issue in your MySQL environment for Password policy you need to reset your password validate the policy.
The validate_password component serves to improve security by requiring account passwords and enabling strength testing of potential passwords. Password Validate exposes system variables that enable you to configure password policy and status variables for component monitoring.
First, you log in with MySQL as a super user and check the current policy rules.
[root@DBATrainings ~]# mysql -u root -p"your password"
Let us see various methods to resolve this issue.
Method 1: Let us see how we can set the password_policy to low:
SET GLOBAL validate_password_policy=LOW;
Method 2: You can also set the same variable in my.cnf file as well.
Method 3: Uninstall Plugin which validates the password
uninstall plugin validate_password;
Let's guide you the step by step solution for the same.
As I said earlier, I strongly prefer that you keep your password complex and protect yourself from malicious attacks.
mysql> SELECT user,authentication_string,plugin,host FROM mysql.user;
mysql> SHOW VARIABLES LIKE 'validate_password%';
mysql> SET GLOBAL validate_password_policy=LOW;
You can choose the complexity as per your project policy. In short MySQL password policy to Low = 0 / Medium = 1 / High = 2. you can choose as Test, Development & Prod environment.
SET GLOBAL validate_password_policy=0;
SET GLOBAL validate_password_policy=1;
SET GLOBAL validate_password_policy=2;
If you found it helps you or someone please like and share with others as well.