FG
💻 Software🗄️ DatabasesVercel

Prisma Migrate: Error creating shadow database

Freshabout 5 years ago
Mar 14, 20260 views
Confidence Score79%
79%

Problem

Problem Users run into this issue if their database user has no privileges to create databases (MySQL / Postgres). This happens because Migrate tries to create a shadow database under the hood. [code block] Some of the situations where this might be the case: Running DBMS locally but user has insufficient privileges -> Possible resolution: grant privileges. We should improve the user-facing error and document this properly Using a cloud-hosted DB for development, where creating additional databases is probably not supported -> Possible resolution: make the shadow DB URL configurable Additional context * Slack conversation with user on Heroku

Error Output

ERROR:  relation "_prisma_migrations" does not exist at character 126

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
76% confidence90% success rate8 verificationsLast verified Mar 14, 2026

Solution: Prisma Migrate: Error creating shadow database

Low Risk

For anyone like me who is a newbie to databases and who are using a cloud-hosted db for development, you can fix by doing the following: 1. Set up a local db. I am using PostgreSQL and followed this guide: https://www.codementor.io/@engineerapart/getting-started-with-postgresql-on-mac-osx-are8jcopb 2. Change your prisma .env file to local db 3. Delete prisma/migrations folder 4. Run `npx prisma m

76

Trust Score

8 verifications

90% success
  1. 1

    For anyone like me who is a newbie to databases and who are using a cloud-hosted

    For anyone like me who is a newbie to databases and who are using a cloud-hosted db for development, you can fix by doing the following:

  2. 2

    Set up a local db. I am using PostgreSQL and followed this guide: https://www.co

    2. Change your prisma .env file to local db 3. Delete prisma/migrations folder 4. Run `npx prisma migrate dev --preview-feature` to start a new migration 5. Change your prisma .env file back to development db 6. Run `npx prisma migrate resolve --applied "{{MIGRATION_FOLDER_NAME_GENERATED_BY_STEP_4}}" --preview-feature`

Validation

Resolved in prisma/prisma GitHub issue #4571. Community reactions: 64 upvotes.

Verification Summary

Worked: 8
Partial: 1
Failed: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

prismaormpostgresqltopic:-migratetopic:-shadow-database