To maximize security, it's recommended that the password validation plugin be enabled and configured with strong settings:
- Enable the Plugin – Check that the plugin is activated by including it in your MySQL server's configuration:
INSTALL PLUGIN validate_password SONAME 'validate_password.so';- Configure Password Policies – Set the desired password validation policies by adding the following lines to your MySQL configuration file (my.cnf or my.ini):
validate_password.policy=STRONG validate_password.length=14 validate_password.mixed_case_count=1 validate_password.number_count=1 validate_password.special_char_count=1 validate_password.check_user_name=ONThese settings require passwords to be at least 14 characters long, include mixed-case letters, numbers, and special characters, and prevent the use of the username within the password. By implementing these security measures, you ensure that all passwords used in your MySQL environment are strong.
For additional details on setting up and configuring the password validation plugin, you can refer to the MySQL documentation:
And for MariaDB users: