Skip to main content
mkdb creds provides three subcommands for working with database credentials: get to display the connection string, copy to put it on your clipboard, and rotate to generate a new password and update it in the running database. Connection strings are formatted as environment variables, ready to paste into a .env file or shell session.

mkdb creds get

mkdb creds get prints the connection string for the default user of a container. The output is formatted as an environment variable assignment.

Flags

string
Name of the container. When provided, mkdb skips the interactive selection menu.

Examples

Interactive mode:
Non-interactive mode:
Pipe directly to a .env file:
Capture in a variable:

Output format

The output is a single line in environment variable format:

mkdb creds copy

mkdb creds copy copies the connection string to your clipboard instead of printing it. Use this when you want to paste credentials into another tool without the string appearing in your terminal history.

Flags

string
Name of the container. When provided, mkdb skips the interactive selection menu.

Examples

Interactive mode:
Non-interactive mode:

mkdb creds rotate

mkdb creds rotate generates a new password for the default user, updates it in the running database, and stores the encrypted version. The new connection string is printed after rotation.

Flags

string
Name of the container. When provided, mkdb skips the interactive selection menu. The container must be running.

Examples

Interactive mode:
Non-interactive mode:
Databases created with --no-auth cannot use mkdb creds rotate. Attempting to rotate credentials on an unauthenticated database returns an error.

Connection string formats

mkdb formats connection strings as environment variables. The exact format depends on the database type and whether authentication is enabled. PostgreSQL:
MySQL:
Redis: