skip to Main Content

Facing this issue for the last 2 days, tried every possible solution e.g reset cache, flushing dns, and everything that could reset ports, reinstalled VScode but nothing seems to work 1

The same connection string works when connecting without using prisma client 2

Here is the connection string in .env file

DATABASE_URL="mongodb+srv://alpha:[email protected]/testing"

Even works with another project in which I am not using prisma 3

When trying to introspect, its giving this error! 4

2

Answers


  1. you are working with prisma in .env file format of DATABASE_URL should be like this if using mongodb Atlas ** follow the steps:
    1.in database choose connect the select "connect to application"
    2.copy the url and past it as ** DATABASE_URL
    in .env file for example

    mongodb+srv://zeta:<password>@zetaapplication.kciyn8z.mongodb.net/?retryWrites=true&w=majority
    

    3.remove everything after mongodb.net / and replace by your database name like below

    mongodb+srv://zeta<password>@zetaapplication.kciyn8z.mongodb.net/your_db_name
    
    Login or Signup to reply.
  2. Check your DATABASE_URL in your .env file and make sure your database url is not inside a " ". if it is, remove the " at both sides.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search