`DATABASE_URL` invalid while `npx prisma migrate ...`??

Environment variables loaded from .env
Prisma schema loaded from schema.prisma
Datasource "db": PostgreSQL database

Error: P1013: The provided database string is invalid. The scheme is not recognized in database URL. Please refer to the documentation in https://www.prisma.io/docs/reference/database-reference/connection-urls for constructing a correct connection string.
In some cases, certain characters must be escaped. Please check
the string for any illegal characters.
Environment variables loaded from .env
Prisma schema loaded from schema.prisma
Datasource "db": PostgreSQL database

Error: P1013: The provided database string is invalid. The scheme is not recognized in database URL. Please refer to the documentation in https://www.prisma.io/docs/reference/database-reference/connection-urls for constructing a correct connection string.
In some cases, certain characters must be escaped. Please check
the string for any illegal characters.
Solution:
@piscopancer url = env("DATABASE_URL") (without quotes)
Jump to solution
7 Replies
Prisma AI Help
You chose to debug with a human. They'll tinker with your query soon. If you get curious meanwhile, hop into #ask-ai for a quick spin!
piscopancer
piscopancerOP2d ago
piscopancer
piscopancerOP2d ago
reading using env(...) does not work but pasting connection string bluntly does prisma 6.9.0
piscopancer
piscopancerOP2d ago
hm
No description
piscopancer
piscopancerOP2d ago
still not working I am missing smth
Solution
unrok4009
unrok400916h ago
@piscopancer url = env("DATABASE_URL") (without quotes)
piscopancer
piscopancerOP16h ago
oh my god I cannot believe how blind I was thanks @unrok4009 !solved !resolved br

Did you find this page helpful?