Solution skill
P1000: Authentication failed against database server
Complete solution
Fixes Prisma error P1000 'Authentication failed against database server' when the database is reachable but rejects the credentials, most often because a native Postgres install already holds port 5432 while the app points at the Docker container. Use when P1000 names the right server. Not for unreachable servers (P1001) or missing databases (P1003).
TL;DR: P1000 means the server is up but said no to your credentials, or you are talking to the wrong server. First check whether something else already owns the port (a native Postgres install is the classic), then fix the credentials or the port mapping.
Error: P1000: Authentication failed against database serverSteps
Check who actually owns the port:
ss -ltnp | grep 5432Expected: if you see a native
postgresprocess instead of docker-proxy, your app is authenticating against the wrong server. That is the cause.Pick one fix:
Option A: map the container to a free port and update the connection string:
services: db: ports: ["5433:5432"]then use port
5433in DATABASE_URL.- Option B: stop the native server (
brew services stop postgresql,sudo systemctl stop postgresql) so the container owns 5432.
Expected:
psqlwith the same credentials you gave Prisma now connects.Re-check the credentials themselves: user, password, and database name must match a real role. Special characters in the password must be URL-encoded in DATABASE_URL. Expected: connecting with a plain
psqlclient using the same values succeeds.Re-run your app. Expected: P1000 gone.
When to use
- The exact code is P1000 and the server host is reachable
- Local Docker setups where a native database may also be installed
When not to use
- P1001: the server is not reachable at all, fix host/port first
password authentication failedfrompsqlwith the provider's own connection string: the password itself is wrong, reset it at the provider
Compatibility
Prisma Client 4.x through 6.x. PostgreSQL and MySQL.
Variant phrasing: P1000 on a managed provider after rotating the password
Re-copy the connection string from the dashboard. Stale strings with the old password keep failing until every consumer is updated.
Variant phrasing: P1000 with special characters in the password
@, /, #, and : in a password break URL parsing. Percent-encode them (%40, %2F, %23, %3A).
Why it happens
Authentication happens against whichever server answers on the host and port. When two servers can answer (native + container), the app silently talks to the wrong one and no password will ever be right. URL parsing mangling special characters is the second most common cause.
Edge cases
- SCRAM vs md5: very old clients against new servers can fail auth even with the right password; update the client.
- Case sensitivity: role names are case-sensitive;
Postgresis notpostgres. - If you use a connection pooler, the pooler user and the database user may differ; authenticate as the pooler user.
Evidence
A contributor setup kept failing with P1000 even though the password in the connection string looked right. The project docs trace the real cause: a native Postgres server was already running on the host, so the app was authenticating against the wrong server entirely. Two fixes are documented and both verified: either point the app at a different host port for the container, or stop the native server first. After either change, the credentials the app sends match the server that receives them and P1000 goes away. Source: https://github.com/mjeffv2/printexchange
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl__wC39O_PIqWhjVnO9Y05Ww" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">P1000: Authentication failed against database server <span>— Vectle</span></a>