meridian db manages the Meridian-managed developer database (MySQL or PostgreSQL, whichever engine the app uses): reset it, seed it, or open a SQL shell against it. Every one of those subcommands connects to the database for the duration and passes DATABASE_URL to what it runs. While meridian dev runs for the same app, they use its connection instead of opening their own, so your dev server keeps working. None of them writes .env. meridian db credential is the exception: it manages credentials for a hosted environment’s database. See External credentials.
Resetting
Reset first asks you to type the database name. In a script, or from a coding agent, pass
--yes with the follow-ups you want:
--migrate and --seed, an interactive run asks whether to migrate and seed. A run without a terminal asks nothing and only prints the commands to finish with. The database is empty until a migration runs.
Seeding
npx prisma db seed with the connection up and DATABASE_URL set in its environment. It exists so your seed script does not need a tunnel of its own. Prisma needs a seed command configured first (prisma.seed in package.json, or migrations.seed in prisma.config.ts on Prisma 6): the Shopify template has none, and meridian db reset only offers to seed when one exists.
The SQL shell
PATH (mysql for MySQL, psql for PostgreSQL), and a built-in REPL when it is not.
-e is the one to reach for in a script or a Makefile: it prints the result and exits rather than waiting for input. For rows a script can parse, use the built-in REPL with --json: meridian db shell --repl -e "select count(*) from Session" --json (on PostgreSQL, quote the table name: 'select count(*) from "Session"'). The mysql and psql clients print plain text, even with --json.
reset, seed and shell also take --port, the local port of the connection they open when no meridian dev runs. They still accept --env-file, which no longer does anything.
On a PostgreSQL app, snapshots and restores of the developer database use pg_dump and psql. Install the PostgreSQL client tools (version 17 or newer, so query cancels work through the gateway) and make sure they are on your PATH.
This is your development database. Your hosted environments’ databases are managed from the dashboard, have their own SQL console with statement classification and escalation rules, and are documented under Database.
External credentials
meridian db credential lists and revokes the credentials a backend running outside Meridian (on AWS, a BI tool) uses to reach a hosted environment’s database through the Meridian database gateway. See External access.
Create and rotate credentials in the dashboard, under Hosting > Database > External access. Each one grants access to a production database from anywhere, so issuing one needs a signed-in browser session, not a CLI token that lives for months on a laptop. Revoking only ever removes access, so you can do it from a terminal the moment a key or password may have leaked.
Each subcommand takes --env <name> with the environment’s name or type (production, staging). Without it, the CLI uses the only environment with a database, or asks when there are several.
listshows each credential’s label, database user, access mode, status, last connection and certificate expiry. It needs access to the app’s hosting.revoke <credential>takes the label or the idlistprints. It asks first unless you pass--yes, then drops the database user, and open connections close within 30 seconds. It needs the Credentials: Manage permission on the app.