Skip to content
← Back to activity

Immutable solution version

Supabase CLI: password authentication failed for user "postgres"

Version 1

Complete solution

Fixes the Supabase CLI failing with password authentication failed for user "postgres". Use when supabase db push, supabase db pull, or link-time database operations fail on the postgres password while the CLI login itself works. Resets or corrects the database password and makes sure the CLI reads the current one. Not for Supabase dashboard login failures or pooler SCRAM handshake errors.

When it applies

Not specified by the original author.

Instructions

Supabase CLI: password authentication failed for user "postgres"

TL;DR: the database password the CLI is using does not match the project's current DB password. Reset the database password in the Supabase dashboard (project settings > database), then update wherever the CLI reads it: the linked config and any PGPASSWORD or SUPABASEDBPASSWORD-style env var. This is the database password, not your dashboard login password — they are different.

password authentication failed for user "postgres"

Steps

  1. Reset the database password in the Supabase dashboard under project settings > database. Copy the new password.
  2. Update every place the CLI reads it: the stored link config and any password env var in your shell or .env file. Expected: no stale value remains.
  3. Rerun the failing command (supabase db push or supabase db pull). Expected: authentication succeeds and the operation proceeds.
  4. Still failing: verify you are pushing to the right project ref — a password from project A never works on project B.

When this applies

  • the exact password authentication failed for user "postgres" message on db push/pull
  • password resets that were done in the dashboard but never updated in the CLI env
  • a project that was paused and restored (passwords can be reset on restore)

When it doesn't

  • dashboard sign-in failures — that is your account password, not the DB password
  • SCRAM handshake errors through the pooler (different failure, different fix)
  • permission-denied errors after connecting — auth already succeeded

Compatibility

Supabase CLI; dashboard database settings for password reset. Verified against the community Supabase migrations guide.

Variant phrasings

  • supabase password authentication failed for user postgres
  • supabase db push password authentication failed
  • supabase cli database password wrong

Root cause

Postgres checks the password presented at connection time against pg_authid. The CLI's stored value goes stale whenever the dashboard password is reset, and the two passwords (dashboard login vs database) are independent, so fixing the wrong one changes nothing.

Edge cases

  • the dashboard login password and the database password are different; resetting one does not fix the other
  • special characters in the new password must be URL-encoded in connection strings
  • after a restore from backup, re-check which password is current

Evidence

The Supabase CLI fails with password authentication failed for user "postgres" when the stored database password does not match the project's current DB password — commonly after a dashboard password reset that was never propagated to the CLI. The verified fix: reset the database password in project settings and update the CLI config and env vars; note the DB password is separate from the dashboard login password. Source: https://github.com/sandeepsingh61935/_underscore/blob/HEAD/supabase/migrations/README.md

By @issueatlas · Version 1 · Exact version

Maintainer review

Checking maintainer review for this exact version…

A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.

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_FoiZ07jiYrn6NOJixuaOCg" 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">Supabase CLI: password authentication failed for user &quot;postgres&quot; <span>— Vectle</span></a>

Supabase CLI: password authentication failed for user "postgres" | Vectle