Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Databases and Redis

MySQL rejects a new password with error 1819

ErrorERROR 1819 (HY000): Your password does not satisfy the current policy requirements

Short answer

Error 1819 means the validate_password component is installed and your cleartext password broke its policy. The default MEDIUM policy wants at least 8 characters with a digit, lower case, upper case and special character. Read the active values, then choose a password that passes. Lower the policy only on development servers.

  • Applies to MySQL 8.0, MySQL 8.4 LTS
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Show the active policy values.

    SHOW VARIABLES LIKE 'validate_password%';
  2. 2Match what you see, then jump to its fix

    1. 1validate_password.policy is MEDIUM (the default) and length is 8 or more.The password is too weak for the MEDIUM policyFix
    2. 2The password looks strong yet is still rejected, and validate_password.check_user_name is ON.The password contains the account's own user nameFix
    3. 3You are on a throwaway local database and the policy is stricter than you want.A development server needs a lower policyFix

What does the error look like?

  • ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

Cause 1 of 3

The password is too weak for the MEDIUM policy

1Check

Test the candidate password without touching any account. A result of 100 means it is strong; a low number tells you it will fail.

SELECT VALIDATE_PASSWORD_STRENGTH('your-candidate-password');

2Fix

Use a password with at least 8 characters including a digit, a lower-case, an upper-case and a special character. The same rule applies to CREATE USER, ALTER USER and SET PASSWORD.

ALTER USER 'app_user'@'localhost' IDENTIFIED BY 'Str0ng!Passw0rd-2026';

3Verify

The statement returns Query OK.

SELECT user, host FROM mysql.user WHERE user = 'app_user';

Confirmed by dev.mysql.com

Did this fix it?

Cause 2 of 3

The password contains the account's own user name

1Check

This check is on by default. It rejects a password that equals the session user's name, forward or reversed.

SHOW VARIABLES LIKE 'validate_password.check_user_name';

2Fix

Pick a password that is not the user name or its reverse.

ALTER USER 'deploy'@'%' IDENTIFIED BY 'Tr1cky!Different-Phrase';

3Verify

Repeat the statement. It should now succeed.

SELECT VALIDATE_PASSWORD_STRENGTH('Tr1cky!Different-Phrase');

Confirmed by dev.mysql.com

Did this fix it?

Cause 3 of 3

A development server needs a lower policy

1Check

Read the current policy first. Do not do this on a production server.

SHOW VARIABLES LIKE 'validate_password.policy';

2Fix

Lower the policy to LOW (8 characters only) with a global variable. It lasts until the server restarts unless you also put it in the option file.

SET GLOBAL validate_password.policy = 'LOW';
SET GLOBAL validate_password.length = 8;

3Verify

Read the variable back.

SHOW VARIABLES LIKE 'validate_password.policy';

Confirmed by dev.mysql.com

Did this fix it?

How do I stop it coming back?

  • Generate passwords with a password manager; they pass MEDIUM without effort.
  • Keep the production policy at MEDIUM or STRONG, and do not copy a dev override to production.
  • Store the real password in a secrets manager, not in the CREATE USER script in git.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Databases

CREATE USER fails with error 1396

CREATE USER is refused for an account whose user and host already exist (error 1396)

Error 1396 on CREATE USER means an account with that exact user and host already exists, often left from an earlier attempt.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.