Random MySQL Hash Generator

Generates a fresh random sample password with crypto.getRandomValues and computes MySQL's legacy PASSWORD() hash for it, using this category's existing MySQL hasher ('*' + upper(hex(SHA1(SHA1(password))))), so you can see the format without typing your own input. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-25

Overview

Introduction

Old MySQL dumps store password hashes in a very specific format: an asterisk followed by 40 uppercase hex characters, and this tool lets you see one instantly without typing anything.

It generates a random sample password and computes its legacy MySQL PASSWORD() hash for you, reusing this category's existing MySQL hasher so the format matches exactly what a pre-5.7 mysql.user table would store.

What Is Random MySQL Hash Generator?

A no-input variant of the MySQL Hash Calculator: instead of typing a password, you get a fresh random sample password and its legacy PASSWORD()-format hash on load, with a Regenerate button for a new pair anytime.

The format is '*' + upper(hex(SHA1(SHA1(password)))), MySQL 4.1 through 5.6's PASSWORD() function, deprecated in 5.7 and removed entirely in 8.0.

How Random MySQL Hash Generator Works

On load and on every Regenerate click, a random word or phrase is drawn from a small built-in bank and combined with a random 8-character hex suffix from crypto.getRandomValues, forming the sample password shown alongside the hash.

That sample is passed to this category's existing calculateMysqlHash function, which hashes it with SHA1 twice in sequence and formats the result as an asterisk-prefixed, uppercase 40-character hex string.

When To Use Random MySQL Hash Generator

Use this for a quick, no-effort example of the legacy MySQL PASSWORD() output format, migration documentation, or a mockup that needs a plausible-looking old-style mysql.user value.

For anything requiring a specific password's hash, use the MySQL Hash Calculator instead; never use this unsalted, fast-hash format for any new authentication design.

Features

Advantages

  • No input required, instantly produces a plausible sample password and its legacy MySQL hash.
  • Uses genuinely secure randomness (crypto.getRandomValues), not a predictable pseudorandom sequence.
  • Reuses the same double-SHA1 implementation as the dedicated calculator, so output is guaranteed to match.

Limitations

  • The sample word bank is small and fixed, so the non-random word portion of the password repeats across regenerations even though the hex suffix and hash always differ.
  • This format has no salting or work factor at all, this generator exists for demonstration, not any real credential-storage example.
  • Not useful if you need the hash of a specific, known password, use the calculator tool for that instead.

Examples

One example regeneration

Input

fixture-record-f6e3a8c5

Output

*A1B2C3D4E5F60718293A4B5C6D7E8F9012345678

One illustrative sample/hash pairing; running the tool again produces a completely different sample and hash, since both are freshly randomized on every regeneration.

Best Practices & Notes

Best Practices

  • Click Regenerate a few times if you're picking an example for migration documentation and want one that reads cleanly.
  • Never treat this tool's output as a real credential; the format has no salt or work factor and is trivially crackable with modern hardware.
  • For a real, reproducible hash of a specific password, switch to the MySQL Hash Calculator instead.

Developer Notes

Generates its sample via this category's shared generateRandomSampleText() helper (crypto.getRandomValues, not Math.random()) and hashes it synchronously with the existing calculateMysqlHash function, matching the useEffect-after-mount pattern used across this category's random generators to avoid a hydration mismatch.

Random MySQL Hash Generator Use Cases

  • Grabbing a quick example legacy MySQL PASSWORD() hash for migration documentation or a tutorial
  • Populating a UI mockup with a plausible-looking old-style mysql.user password hash value
  • Seeing the format's asterisk-prefixed 41-character output without typing your own input
  • Cross-checking this output format against the identical MariaDB PASSWORD() construction

Common Mistakes

  • Expecting the same sample/hash pair to reappear; both are freshly randomized on every load and Regenerate click.
  • Assuming this reflects current MySQL authentication; 5.7+ deprecated and 8.0 removed PASSWORD() entirely.
  • Using this when you actually need the hash of a specific, known password; the MySQL Hash Calculator is the right tool for that.

Tips

  • Need the input to chain into another tool? Use the send-to-tool menu on the hash output panel.
  • This exact format is shared with MariaDB, try the Random MariaDB Hash Generator if that framing fits your context better.

References

Frequently Asked Questions