Issue dynamic database credentials from HashiCorp Vault for MySQL

domain: developer.hashicorp.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Enable the database secrets engine (vault secrets enable database) and configure a connection for MySQL using the mysql-database-plugin, supplying the connection URL with a privileged account that can create users
  2. Create a Vault role (vault write database/roles/<name>) specifying creation_statements with the SQL to grant appropriate privileges, and set a TTL and max TTL for the dynamic credentials
  3. Applications authenticate to Vault and read database/creds/<role> to receive a dynamically created username and password valid for the lease duration
  4. Configure the application to handle lease renewal (vault lease renew) before expiry, or to re-read credentials and reconnect when a lease expires
  5. Revoke credentials explicitly on application shutdown or credential compromise by calling vault lease revoke; Vault will drop the database user
  6. Audit Vault's audit log to trace which application entity requested which credentials and when they were revoked

Known gotchas

Related routes

Configure Vault dynamic database credentials for PostgreSQL
developer.hashicorp.com · 6 steps · unrated
Configure HashiCorp Vault's database secrets engine to issue short-lived, auto-expiring PostgreSQL credentials to applications
developer.hashicorp.com · 5 steps · unrated
Read and write secrets using HashiCorp Vault KV v2
developer.hashicorp.com · 6 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans