Prisma + Supabase Error P1001
Abdullah Bashir

Abdullah Bashir @digitaldrreamer

About: 20y/o @ www.goremote.africa Fullstack Dev | Avid Reader | Loves Svelte(Kit) for it's simplicity | AI and IoT enthusiast

Location:
Nigeria
Joined:
Nov 18, 2022

Prisma + Supabase Error P1001

Publish Date: Jul 30 '24
6 2

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`.
Enter fullscreen mode Exit fullscreen mode

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.

Comments 2 total

  • Code Monkey
    Code MonkeyFeb 18, 2025

    Hi, Abdullah.
    How's it going?
    I have the exact same errors when I migrate my schema to supabase.
    I did what you wrote above exactly, and I still see that issues
    Image description
    What should I do at this point.
    Thanks

Add comment