So I was facing this error while connecting postgreSQL with prisma
Authentication failed against database server at localhost, the provided database credentials for johndoe are not valid.I spent 2 days solving this and these were the errors in my code
There were 2 .env files, 1st in the folder of my server and 2nd in the parent folder (this was a monorepo) with
same variable in both files i.e. DATABASE_URL
- install
dotenvusing yarn
yarn add dotenv- Add this code in
app.module.tsormain.tsfile
import { config } from "dotenv";
config();