It seems that I may have inadvertently loaded the password validation plugin in MySQL 5.7. This plugin seems to force all passwords to comply to certain rules.
I would l
If you want to make exceptions, you can apply the following "hack". It requires a user with DELETE and INSERT privilege for mysql.plugin
system table.
uninstall plugin validate_password;
SET PASSWORD FOR 'app' = PASSWORD('abcd');
INSTALL PLUGIN validate_password SONAME 'validate_password.so';
Bland security disclaimer: Consider, why you are making your password shorter or easier and perhaps consider replacing it with one that is more complex. However, I understand the "it's 3AM and just needs to work" moments, just make sure you don't build a system of hacks, lest you yourself be hacked
I was having a problem on Ubuntu 18.04 on Mysql. When I needed to create a new user, the policy was always high.
The way I figured out how to disable, for future colleagues who come to investigate, was set to low.
Login to the mysql server as root
mysql -h localhost -u root -p
Set the new type of validation
SET GLOBAL validate_password_policy=0; //For Low
Restart mysql
sudo service mysql restart
On some installations, you cannot execute this command until you have reset the root password. You cannot reset the root password, until you execute this command. Classic Catch-22.
One solution not mention by other responders is to temporarily disable the plugin via mysql configuration. In any my.cnf
, in the [mysqld]
section, add:
skip-validate_password=1
and restart the server. Change the password, and set the value back to 0, and restart again.
For mysql 8.0 the command to disable password validation component is:
UNINSTALL COMPONENT 'file://component_validate_password';
To install it back again, the command is:
INSTALL COMPONENT 'file://component_validate_password';
If you just want to change the policy of password validation plugin:
SET GLOBAL validate_password.policy = 0; // For LOW
SET GLOBAL validate_password.policy = 1; // For MEDIUM
SET GLOBAL validate_password.policy = 2; // For HIGH
Here is what I do to remove the validate password plugin:
mysql -h localhost -u root -p
uninstall plugin validate_password;
UNINSTALL COMPONENT 'file://component_validate_password';
I would not recommend this solution for a production system. I used this solution on a local mysql instance for development purposes only.
Uninstall:
mysql> uninstall plugin validate_password;
An uninstalled plugin is not displayed by show plugins;
Install:
mysql> install plugin validate_password SONAME 'validate_password.so';
Disabled by configuration:
[mysqld]
validate_password = OFF
A plugin can be disabled by configuration only if installed.