crypto_mysql_password_generator
Generate MySQL server-side password hashes for any plaintext. Supports SHA1-based formats (mysql41-57) and caching_sha2_password (mysql80). Returns hash with version, algorithm, and salt info.
Instructions
MySQL Password Hash Generator. Generate the server-side password hash MySQL stores in mysql.user.authentication_string for a given plaintext, across MySQL versions. Use it to build CREATE USER / SET PASSWORD statements or seed test fixtures; use crypto_postgresql_password_generator for PostgreSQL (md5/SCRAM) hashes instead, and crypto_password_generator to invent a new random plaintext rather than hash one. Runs locally on the input you provide: read-only, non-destructive, contacts no database or external service, and is rate-limited (30 requests/min anonymous). SHA1-based formats (mysql41/5/55/56/57) are deterministic; the mysql80/mysql8 caching_sha2_password format uses a fresh random salt, so its hash differs on every call. Returns the hash plus its version label, algorithm, format, and (for 8.0) salt and iterations.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| password | Yes | Plaintext password to hash. Required and non-empty. | |
| version | No | Target MySQL format. mysql41/5/55/56/57 produce the SHA1(SHA1()) PASSWORD() hash; mysql80/mysql8 produce a salted caching_sha2_password hash; old_mysql/mysql323 produce the deprecated, insecure pre-4.1 hash. | mysql57 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| original | No | The plaintext password, echoed back. | |
| hash | No | The MySQL-format password hash (e.g. *HEX, or $A$005$... for 8.0). | |
| version | No | Human-readable label of the MySQL format used. | |
| algorithm | No | Hash algorithm, e.g. SHA1(SHA1(password)) or PBKDF2-SHA256. | |
| format | No | Description of the output encoding/format. | |
| iterations | No | PBKDF2 iteration count (caching_sha2_password / mysql80 only). | |
| salt | No | Base64 random salt used (caching_sha2_password / mysql80 only). | |
| warning | No | Present only for deprecated old_mysql/mysql323 formats. |