#P1001: Can't reach database server at `db.hjpdsbahfzphupirxxkv.supabase.co:5432`
3 messages · Page 1 of 1 (latest)
The error P1001: Can't reach database server at db.hjpdsbahfzphupirxxkv.supabase.co:5432 means Prisma cannot connect to your Supabase PostgreSQL database. This is a common issue and can have several causes. Here are steps and checks based on real user experiences and official guidance:
-
Check Credentials & Connection String
- Make sure your
DATABASE_URLin.envis correct, including the password and host. If your password contains special characters, ensure it is percent-encoded (see here) Can't reach database server at ....
- Make sure your
-
Test Manual Connection
- Try connecting with
psqlor a GUI (like DBeaver) using the same connection string. If this works, the issue is likely Prisma-specific Cannot connect to Supabase database.
- Try connecting with
-
Network Issues
- Disable IPv6 on your machine, as some users found this resolved the issue Unable to reach database server at ....
- Ensure your IP is not blocked or banned by Supabase db pull can't connect to supabase ....
-
Supabase Pooler vs. Direct Connection
- For migrations, use the direct connection string (
db.<ref>.supabase.co:5432). For Prisma Client, use the pooler (aws-0-<region>.pooler.supabase.com:6543) Unable to reach database server at ....
- For migrations, use the direct connection string (
-
Timeouts
- Add
connect_timeout=30to your connection string to help with slow connections Unable to reach database server at ....
- Add
-
Supabase Project Settings
- Double-check your Supabase project’s network restrictions and ensure the database is active P1001 Supabase Connection Failure ...
.
If you’ve tried all the above and still get P1001, it may be a platform-specific issue (e.g., macOS ARM64) or a temporary Supabase/Prisma compatibility problem. In such cases, try from a different machine or open a GitHub issue with detailed logs and your environment info.
Let me know if you need help with a specific step!