Prisma + Supabase Error P1001

I was trying to use Supabase’s PostgreSQL database with Prisma for a project. Don’t ask me why.

I kept getting this error while I was running npx prisma migrate dev –name init to initialize my database schema:

npx prisma migrate dev –name init

E…


This content originally appeared on DEV Community and was authored by Abdullah Bashir

I was trying to use Supabase's PostgreSQL database with Prisma for a project. Don't ask me why.

I kept getting this error while I was running npx prisma migrate dev --name init to initialize my database schema:

npx prisma migrate dev --name init

Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
Datasource "db": PostgreSQL database "postgres", schema "public" at "postgres.gunjffzpoblrok******"
Error: P1001: Can't reach database server at `postgres.gunjffzpoblrok******:5432`

Please make sure your database server is running at `postgres.gunjffzpoblrok******:5432`.

Terminal Screenshot

After a whole lot of brain-racking and literal trauma, I found the bloody answer.

Apparently,

Don't use special characters in your database password. They could cause issues.

If you're using Supabase, go to Project Settings...

Project Settings

Database settings...
Database settings

Scroll down and click reset database password. Change the password (letters only) and update it in your .env file in your code.
Reset Password

Rerun the command, and you're good to go.
npx prisma migrate dev --name init

Happy hacking!

PS: Prisma Migration got stuck minutes later (facepalm). Solution here.


This content originally appeared on DEV Community and was authored by Abdullah Bashir


Print Share Comment Cite Upload Translate Updates
APA

Abdullah Bashir | Sciencx (2024-07-30T22:43:05+00:00) Prisma + Supabase Error P1001. Retrieved from https://www.scien.cx/2024/07/30/prisma-supabase-error-p1001/

MLA
" » Prisma + Supabase Error P1001." Abdullah Bashir | Sciencx - Tuesday July 30, 2024, https://www.scien.cx/2024/07/30/prisma-supabase-error-p1001/
HARVARD
Abdullah Bashir | Sciencx Tuesday July 30, 2024 » Prisma + Supabase Error P1001., viewed ,<https://www.scien.cx/2024/07/30/prisma-supabase-error-p1001/>
VANCOUVER
Abdullah Bashir | Sciencx - » Prisma + Supabase Error P1001. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/07/30/prisma-supabase-error-p1001/
CHICAGO
" » Prisma + Supabase Error P1001." Abdullah Bashir | Sciencx - Accessed . https://www.scien.cx/2024/07/30/prisma-supabase-error-p1001/
IEEE
" » Prisma + Supabase Error P1001." Abdullah Bashir | Sciencx [Online]. Available: https://www.scien.cx/2024/07/30/prisma-supabase-error-p1001/. [Accessed: ]
rf:citation
» Prisma + Supabase Error P1001 | Abdullah Bashir | Sciencx | https://www.scien.cx/2024/07/30/prisma-supabase-error-p1001/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.