我正在尝试使用pg库连接到我的数据库,但是它一直使用错误的用户名。这是我的代码:
const { Pool } = require('pg')
const dbcreds = require("./dbconfig.json")
const pool = await new Pool({
host: dbcreds.dbhost,
user: dbcreds.user, // dbcreds.user = 'dbuser'
password: dbcreds.dbpassword,
database: dbcreds.dbname,
})
await pool.connect()
我收到一个错误{ error: password authentication failed for user "robert"