So im trying to connect my local postgres DB to my node.js server. But im facing the ennoying issue of wrong username.
error: password authentication failed for user "Yoav Genish"
error log:
name: 'error',
length: 169,
severity: 'FATAL',
code: '28P01',
The Yoav Genish is my win10 user name and postgres just default it as the superadmin.
I have a user with premission for the DB called me and i specified it in a .env file.
Here's the .env file:
HOST='localhost'
USER = 'me'
DATABASE= 'api'
PASSWORD= 'password'
PORT=5432 '
and here's the code:
require('dotenv').config();
const Pool= require('pg').Pool;
const ENVDATA = {
HOST: process.env.HOST,
USER: process.env.USER,
DATABSE: process.env.DATABASE,
PORT: process.env.PORT,
PASSWORD: process.env.PASSWORD
}
var pool = new Pool(ENVDATA);
Also i verified the the ENVDATA is indeed the data in the .env file.
again, the issue is that i want to log into the local DB with the me username, but i keep getting the above error.
thanks in advance!