This error means the connection pooler isn't recognizing the credentials. Here's how to fix it:
Your DATABASE_URL should look like one of these:
postgresql://postgres.ygudmijcffyuarwoywmq:[PASSWORD]@aws-0-ap-south-1.pooler.supabase.com:6543/postgres
postgresql://postgres.ygudmijcffyuarwoywmq:[PASSWORD]@aws-0-ap-south-1.pooler.supabase.com:5432/postgres
postgresql://postgres:[PASSWORD]@db.ygudmijcffyuarwoywmq.supabase.co:5432/postgres
For connection pooler, the username MUST include the project ref:
- ✅
postgres.ygudmijcffyuarwoywmq - ❌
postgres(won't work with pooler)
For direct connection, use simple username:
- ✅
postgres
- Must be your database password (not Supabase account password)
- Find it in: Settings → Database → "Reset Database Password" if you forgot it
- Should be URL-encoded if it contains special characters (@, :, /, etc.)
-
Wrong password: If you don't remember it, reset it in Supabase Dashboard
-
Special characters in password: Need to be URL-encoded
@→%40:→%3A/→%2F#→%23
-
Wrong username format: Must match connection type (pooler vs direct)
https://supabase.com/dashboard/project/ygudmijcffyuarwoywmq/settings/database
You'll see two sections:
- Connection string (direct connection)
- Connection pooling (pooler connection)
For Connection pooling → Transaction mode, you should see:
postgresql://postgres.ygudmijcffyuarwoywmq:[YOUR-PASSWORD]@aws-0-ap-south-1.pooler.supabase.com:6543/postgres
Replace [YOUR-PASSWORD] with your actual database password (the one you set when creating the project, or reset it if you don't remember).
DATABASE_URL=postgresql://postgres.ygudmijcffyuarwoywmq:your-actual-password@aws-0-ap-south-1.pooler.supabase.com:6543/postgres- No spaces
- No quotes
- All on one line
- Replace
your-actual-passwordwith your real password
After updating:
node debug-env.js
npm run dev
curl http://localhost:3000/healthShould show: "database":"connected"
If the pooler keeps failing, use direct connection:
DATABASE_URL=postgresql://postgres:your-password@db.ygudmijcffyuarwoywmq.supabase.co:5432/postgres
Note the differences:
- Username:
postgres(NOTpostgres.ygudmijcffyuarwoywmq) - Host:
db.ygudmijcffyuarwoywmq.supabase.co - Port:
5432(NOT6543)
If you're not sure about your password:
- Go to: https://supabase.com/dashboard/project/ygudmijcffyuarwoywmq/settings/database
- Click "Reset Database Password"
- Copy the new password
- Update DATABASE_URL immediately
- Test again
Most Common Fix: Make sure your password is correct and matches what's in Supabase Dashboard!