×


MySQL error 1819 HY000

Generally, MySQL error 1819 happens in the process of creating a MySQL user with a relatively weak password.

In the real sense, this is not an error. Instead, it is a notification that says we are using a password that does not meet the recommended password policy requirements.

Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to fix MySQL related errors.

In this context, we shall look into how to fix this MySQL error.


Nature of MySQL error 1819 (HY000) ?

Basically, this error signifies that we are using a weak password.

For example, when creating a user, this error occurred:

mysql> create user 'ibmimedia'@'localhost' IDENTIFIED BY 'mypassword';

In this case, the password is extremely weak and can present a security risk.

The MySQL database ships with a validate_password plugin which when enabled, enforces a password validation policy. 

The plugin enforces 3 levels of a password validation policy. 

They are:

i. LOW: Allows users to set a password of 8 or fewer characters.

ii. MEDIUM: Allows users to set a password of 8 or fewer characters with mixed cases and special characters.

iii. STRONG: Allows users to set a password that has all the attributes of a medium-level password with the inclusion of a dictionary file.


The password policy is set to MEDIUM by default. 

We run the below command to confirm the password policy level:

$ SHOW VARIABLES LIKE 'validate_password%';

In case, if we run the command and get the output empty set, then the plugin is not enabled yet.

In order to enable the plugin, we run the below commands:

mysql> select plugin_name, plugin_status from information_schema.plugins where plugin_name like 'validate%';
mysql> install plugin validate_password soname 'validate_password.so';

Then, to confirm the activation of the plugin, we run the below command:

mysql> select plugin_name, plugin_status from information_schema.plugins where plugin_name like 'validate%';


Steps to resolve MySQL error 1819 (HY000) in Linux ?

In order to resolve this error message, we set the password validation policy to the lowest level. 

In return, this will create an avenue for setting weak passwords which can ultimately cause our database to be compromised by hackers.

Here are the steps to change the MySQL Password Validation Policy:

1. First, we set a lower password validation policy:

mysql> SET GLOBAL validate_password_policy=LOW;

OR

mysql> SET GLOBAL validate_password_policy=0;

2. Then we can confirm the password validation policy level:

$ SHOW VARIABLES LIKE 'validate_password%';

3. Now we can proceed and assign a relatively weak password as per our wish:

mysql> create user 'ibmimedia'@'localhost' IDENTIFIED BY 'mypassword';

4. If we want to revert to the 'MEDIUM' password policy level, then we can run the below command:

mysql> SET GLOBAL validate_password_policy=MEDIUM;

5. In case, if the password policy doesn't change then we exit from the MySQL prompt and restart the MysqL service from Terminal window:

$ sudo systemctl restart mysql


How to Disable password validation policy in MySQL ?

If we want to create users with weak password, we simply disable the Validate Password component altogether and re-enable it back after creating the users.

i. We run the below command to log into the MySQL server:

$ mysql -u root -p

ii. We run the following command to temporarily disable Validate Password component:

mysql> UNINSTALL COMPONENT "file://component_validate_password";

iii. Then we create the users with any password:

mysql> create user 'ibmimedia'@'localhost' identified by '123456';

iv. After that, we enable the Validate Password component. 

For that, we run the below command:

mysql> INSTALL COMPONENT "file://component_validate_password";


[Need urgent assistance in fixing MySQL error? – We'll help you. ]


Conclusion

This article will guide you on how to resolve MySQL error 1819 (HY000) which happens when creating a MySQL user with a relatively weak password.  

Because of validate_password_policy we applied on database, we are not able to change and assign simple or weak passwords it don't allow to to change password and came up with error.

To resolve this error, We can check validate_password_policy applied on machine. Also you can change your password under Low policy.


Solution to MySQL Error Your Password does not satisfy the Current Policy Requirements:

1. Set the Password_policy value to low, next is setting the same Password_Policy value in my.cnf file and the last is uninstalling the plugin that is used for validating password.

2. Set the Password_Policy to low:

Default Password level of plugin can be changed at runtime or using config file. 

To do this, default authentication plugin has to be checked:

SHOW VARIABLES LIKE 'default authentication plugin';

3. For checking the current variables for validating the password you should run the following command:

SHOW VARIABLES LIKE 'validate_password%';

4. Validate_password is a variable that is used to inform the server about the validate_password plugin. 

This plugin tests the passwords and improve security. 

Following output will be displayed, if you run the above command:

mysql> SHOW VARIABLES LIKE 'validate_password%';