1372
MySQLerrorpermissionshigh confidence

Password hash should be a 41-digit hex number

Production Risk

Low — statement fails; password is not changed.

What this means

A password hash supplied to PASSWORD() or in a GRANT statement is not in the expected 41-character hex format.

Why it happens
  1. 1Providing a plaintext password where a hash is expected
  2. 2Using a hash generated by a different algorithm
How to reproduce
trigger — this will error
trigger — this will error
SET PASSWORD = 'not_a_valid_hash';

expected output

ERROR 1372 (HY000): Password hash should be a 41-digit hexadecimal number

Fix

Use ALTER USER with a plaintext password

Use ALTER USER with a plaintext password
ALTER USER 'user'@'host' IDENTIFIED BY 'plaintext_password';

Why this works

MySQL hashes the password internally; do not pre-hash it.

What not to do

Version notes

Sources
Official documentation ↗

MySQL 8.0 — 1372 ER_PASSWORD_FORMAT

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All MySQL errors