Local development with Prisma Postgres

does anyone know what version of the cli makes this port option available? https://www.prisma.io/docs/postgres/database/local-development#2-applying-migrations-and-seeding-data I'm on 6.8.2 and it doesnt' seem to be available
! unknown or unexpected option: --port
! unknown or unexpected option: --port
--- additionally, does anyone know why Prisma Postgres is trying to access the port set in in the proxy and env variables + 1 to run migrations?
> @acme/[email protected] db:migrate:dev /Users/work/acme/monorepo/packages/database
> prisma migrate dev

Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database "postgres", schemas "acme, public" at "localhost:51213"

Error: P1001

Can't reach database server at localhost:51214

Please make sure your database server is running at localhost:51214.

 ELIFECYCLE  Command failed with exit code 1.
> @acme/[email protected] db:migrate:dev /Users/work/acme/monorepo/packages/database
> prisma migrate dev

Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database "postgres", schemas "acme, public" at "localhost:51213"

Error: P1001

Can't reach database server at localhost:51214

Please make sure your database server is running at localhost:51214.

 ELIFECYCLE  Command failed with exit code 1.
port 51214 isn't listed anywhere in our entire codebase or env vars
12 Replies
Prisma AI Help
You selected the carefully hand-crafted route. A dev artisan will respond soon. Meanwhile, the #ask-ai channel awaits if you're curious!
followbl
followblOP5d ago
nvm, found both in docs port is only available for --dev
followbl
followblOP5d ago
No description
followbl
followblOP5d ago
here's the prisma postgres ports doesn't solve why I can't reach that database to run migrations though
Nurul
Nurul5d ago
Hey! To confirm, you are still unable to run migrations when you are using local prisma postgres with npx prisma dev command?
followbl
followblOP5d ago
yea, unable to run migrations @Nurul (Prisma) have gotten this down to I cannot get Prisma Postgres to work locally. The remote Prisma Postgres, hosted by y'all works fine. Migrations, connections, etc. I cannot get it running (migrating) locally.
[12:35:14] 😺 ~/work/monorepo/packages/database (db-migration|✔) 🏖️ lsof -i :51213,51214,51215 | grep LISTEN 12:35:14
node 70667 b 19u IPv4 0x3ab2270dd2f4eed1 0t0 TCP localhost:51215 (LISTEN)
node 70667 b 68u IPv4 0x338ef4faf0612d1c 0t0 TCP localhost:51214 (LISTEN)
node 70667 b 69u IPv6 0x3e05a3af28ca8ea4 0t0 TCP *:51213 (LISTEN)
[12:35:14] 😺 ~/work/monorepo/packages/database (db-migration|✔) 🏖️ lsof -i :51213,51214,51215 | grep LISTEN 12:35:14
node 70667 b 19u IPv4 0x3ab2270dd2f4eed1 0t0 TCP localhost:51215 (LISTEN)
node 70667 b 68u IPv4 0x338ef4faf0612d1c 0t0 TCP localhost:51214 (LISTEN)
node 70667 b 69u IPv6 0x3e05a3af28ca8ea4 0t0 TCP *:51213 (LISTEN)
all the ports are listening as they should so the dev server(s) is running I just cannot connect locally via the tunnel at all just constantly running in to this...
> @acme/[email protected] db:migrate:dev /Users/work/acme/monorepo/packages/database
> prisma migrate dev

Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database "postgres", schemas "acme, public" at "localhost:51213"

Error: P1001

Can't reach database server at localhost:51214

Please make sure your database server is running at localhost:51214.

 ELIFECYCLE  Command failed with exit code 1.
> @acme/[email protected] db:migrate:dev /Users/work/acme/monorepo/packages/database
> prisma migrate dev

Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database "postgres", schemas "acme, public" at "localhost:51213"

Error: P1001

Can't reach database server at localhost:51214

Please make sure your database server is running at localhost:51214.

 ELIFECYCLE  Command failed with exit code 1.
Nurul
Nurul4d ago
The prisma dev command was launched in the last release, so it might be possible that there is some issue. Can you share the output you get when your run npx prisma --version?
Igal
Igal4d ago
Hey 👋 Can you double check the URL output by prisma dev matches the one you're passing as provider.url in your schema file? The URL you'd receive from prisma dev for the default ports changed in a release yesterday.
followbl
followblOP4d ago
Environment variables loaded from .env
prisma : 6.8.2
@prisma/client : 6.8.2
Computed binaryTarget : darwin-arm64
Operating System : darwin
Architecture : arm64
Node.js : v22.13.1
TypeScript : 5.8.3
Query Engine (Node-API) : libquery-engine 2060c79ba17c6bb9f5823312b6f6b7f4a845738e (at node_modules/@prisma/engines/libquery_engine-darwin-arm64.dylib.node)
Schema Engine : schema-engine-cli 2060c79ba17c6bb9f5823312b6f6b7f4a845738e (at node_modules/@prisma/engines/schema-engine-darwin-arm64)
Schema Wasm : @prisma/prisma-schema-wasm 6.8.0-43.2060c79ba17c6bb9f5823312b6f6b7f4a845738e
Default Engines Hash : 2060c79ba17c6bb9f5823312b6f6b7f4a845738e
Studio : 0.511.0
Environment variables loaded from .env
prisma : 6.8.2
@prisma/client : 6.8.2
Computed binaryTarget : darwin-arm64
Operating System : darwin
Architecture : arm64
Node.js : v22.13.1
TypeScript : 5.8.3
Query Engine (Node-API) : libquery-engine 2060c79ba17c6bb9f5823312b6f6b7f4a845738e (at node_modules/@prisma/engines/libquery_engine-darwin-arm64.dylib.node)
Schema Engine : schema-engine-cli 2060c79ba17c6bb9f5823312b6f6b7f4a845738e (at node_modules/@prisma/engines/schema-engine-darwin-arm64)
Schema Wasm : @prisma/prisma-schema-wasm 6.8.0-43.2060c79ba17c6bb9f5823312b6f6b7f4a845738e
Default Engines Hash : 2060c79ba17c6bb9f5823312b6f6b7f4a845738e
Studio : 0.511.0
yup, just double checked. went through the dev upstart again, went as far as to even hardcode it
followbl
followblOP4d ago
No description
followbl
followblOP4d ago
still same error
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database "postgres", schemas "public" at "localhost:51213"

Error: P1001

Can't reach database server at `localhost:51214`

Please make sure your database server is running at `localhost:51214`.
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database "postgres", schemas "public" at "localhost:51213"

Error: P1001

Can't reach database server at `localhost:51214`

Please make sure your database server is running at `localhost:51214`.
Igal
Igal4d ago
can you start the server with --debug and paste the startup sequence logs?

Did you find this page helpful?