How to Fix “MySQL ERROR 1819 (HY000):” in Linux

When creating a MySQL user with a relatively weak password, you might encounter the error ‘MySQL ERROR 1819 (HY000): Your password does not satisfy the current policy requirements’. Technically, this is not an error, but a notification that you are using a password that does not meet the recommended password policy requirements.

In other words, you are using a weak password that can easily be guessed or brute-forced. The built-in security mechanism discourages users from creating weak passwords which can render your database prone to breaches.

For example, I ran into the error when creating a user as shown

mysql> create user ‘tecmint’@’localhost’ IDENTIFIED BY ‘mypassword’;
MySQL ERROR 1819 (HY000)
MySQL ERROR 1819 (HY000)

It’s a no brainer that the password is extremely weak and can present a security risk.

How to Solve MySQL ERROR 1819 (HY000) in Linux

The MySQL database ships with a validate_password plugin which when enabled, enforces a password validation policy. There are 3 levels of password validation policy that are enforced by the plugin.

  • LOW: Allows users to set a password of 8 or fewer characters.
  • MEDIUM: Allows users to set a password of 8 or fewer characters with mixed cases and special characters.
  • STRONG: Allows users to set a password that has all the attributes of a medium-level password with the inclusion of a dictionary file.

By default, the password policy is set to MEDIUM. You can confirm the password policy level, by executing the command:

$ SHOW VARIABLES LIKE 'validate_password%';
Check Mysql Password Policy
Check Mysql Password Policy

If you run the command and get the output empty set, then the plugin is not enabled yet.

To enable the validate_password plugin, run the commands below.

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

To confirm that the plugin is activated, run the command.

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

You should get the output shown below:

Enable Mysql Password Policy
Enable Mysql Password Policy

To resolve the issue, you need to set the password validation policy to the lowest level. I know this sounds counterintuitive as it creates an avenue for setting weak passwords which can ultimately cause your database to be compromised by hackers.

However, if you still insist on having your way, here’s what you can do.

How to Change MySQL Password Validation Policy

To resolve the MySQL ERROR 1819 (HY000) error, set a lower password validation policy as shown.

mysql> SET GLOBAL validate_password_policy=LOW;
mysql> SET GLOBAL validate_password_policy=0;

You can thereafter confirm the password validation policy level.

$ SHOW VARIABLES LIKE 'validate_password%';
Change Mysql Password Policy
Change Mysql Password Policy

Now you can proceed and assign a relatively weak password as per your wish.

mysql> create user ‘tecmint’@’localhost’ IDENTIFIED BY ‘mypassword’;

To revert to the ‘MEDIUM’ password policy level, simply invoke the command:

mysql> SET GLOBAL validate_password_policy=MEDIUM;

Personally, I wouldn’t recommend setting a lower level password policy for obvious reasons. Whether it’s a normal user or a database user, it’s recommended to always set a strong MySQL password with more than 8 characters with a mix of uppercase, lowercase, numeric and special characters.

This guide is for the sake of those who want to know how to navigate such an error, otherwise, setting a strong password is always recommended.

Hey TecMint readers,

Exciting news! Every month, our top blog commenters will have the chance to win fantastic rewards, like free Linux eBooks such as RHCE, RHCSA, LFCS, Learn Linux, and Awk, each worth $20!

Learn more about the contest and stand a chance to win by sharing your thoughts below!

James Kiarie
This is James, a certified Linux administrator and a tech enthusiast who loves keeping in touch with emerging trends in the tech world. When I'm not running commands on the terminal, I'm taking listening to some cool music. taking a casual stroll or watching a nice movie.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

1 Comment

Leave a Reply
  1. Please define the password character length in the above point “STRONG: Allows users to set a password that has ALL THE ATTRIBUTES of a medium-level password with the inclusion of a dictionary file.”.

    while installing PHPMyAdmin I got an error “Configuring PHPMyAdmin. An error occurred while installing the database:

    mysq1 said: ERROR 1819 (HYOOO) at line 1: your password does not satisfy the current policy requirements”. My password length was 24 characters and it is the same as mysql password.

    how to resolve this issue?


Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.