Introduction

MySQL’s password policy level, defined by the “validate_password_policy” system variable, enforces constraints on new passwords to ensure they are secure

Prerequisites
1. A sudo privileged user to SSH the server
2. Mysql root password

Implementation

MySQL’s password policy has three levels: LOW, MEDIUM, and STRONG

LOW: Tests password length only, requiring passwords to be at least 8 characters long

MEDIUM: Adds the conditions that passwords must contain at least one numeric character, one lowercase character, one uppercase character, and one special (nonalphanumeric) character

STRONG:  At least 12 characters long but 14 or more is better. A combination of uppercase letters, lowercase letters, numbers, and symbols. Not a word that can be found in a dictionary or the name of a person, character, product, or organization

Step 1: SSH the server where the MySQL password policy level needs to change

$ ssh username@IP

Step 2: Log in to the Mysql with root access

$ mysql -u root -p

Step 3: Execute query to check the current setting of “validate_password”

> > SHOW VARIABLES LIKE 'validate_password%';

Step 4: Execute the below query to change the password policy from Medium to Low

> > SET GLOBAL validate_password_policy=LOW;

Step 5: Restart the MySQL service

$ systemctl restart mysql

Leave a Reply