# MySQL / MariaDB temporary access

[Temporary access overview](/docs/concepts/temporary-access) covers target setup, connection methods, and credential handling.

MySQL and MariaDB use client-computed password hashes for temporary users. The
`mysql_native_password` plugin stores an account's secret as
`*<UPPER(HEX(SHA1(SHA1(password))))>`, and
`CREATE USER … IDENTIFIED WITH mysql_native_password AS '*…'` stores that string
**verbatim** — it isn't re-hashed. So the client computes the hash locally and
sends only that. The double-SHA1 hash **cannot log in**: `mysql_native_password`
auth is a challenge-response that verifies knowledge of `SHA1(password)` (the
preimage of the stored inner hash), which a dump of `mysql.user` doesn't reveal.

Two MySQL-specific differences from [PostgreSQL](/docs/guides/dynamic-postgres):

- **No account expiry timestamp.** MySQL has no `VALID UNTIL` for an account, so
  the broker's alarm-driven `DROP USER` is the *only* thing that expires a lease
  (which is exactly what the broker is for).
- **Inline grants, no group role.** MySQL roles need activation
  (`SET DEFAULT ROLE`), an awkward fit for a plain connection URL — so the
  read-only / read-write presets apply their `GRANT`s **inline per user** at
  mint, scoped to the target database. There is no one-time setup query.

## Provider compatibility

`CREATE USER … IDENTIFIED WITH mysql_native_password AS
'*…'` stores the pre-hashed value as-is on **standard MySQL 8, MariaDB, AWS RDS
/ Aurora, Cloud SQL, Azure**, and self-hosted. The in-DO executor authenticates
its admin connection with **`mysql_native_password` or `caching_sha2_password`
(MySQL 8's default) over TLS**, so it works against a default MySQL 8 admin
account as well as MariaDB.

See the [verifier compatibility limits](/docs/concepts/temporary-access#provider-compatibility) for control-plane-proxied databases.

See the [CLI reference](/docs/reference/cli) and [API reference](/docs/reference/api) for commands and endpoints.
