数据库连接时发生验证错误"/>
与postgres数据库连接时发生验证错误
所以我正在开发Web应用程序的后端。我一直收到此错误:用户“ postgre”的密码验证失败
const express = require("express")
const router = express.Router()
const Pool = require('pg').Pool
const pool = new Pool({
user: 'postgre',
host: 'localhost',
database: 'p2p',
password: 'hello',
port: 5432,
})
router.get('/',(req,res)=>{
res.render('physician/login')
})
//table: doc_reg,
router.post('/loggedin',(req,res)=>{
const {user_name,pw_1}=req.body
pool.query('INSERT INTO doc_reg (username,pw) VALUES ($1,$2)',[user_name,pw_1],(err, results)=>{
if (err){
console.log(err)
}
res.render('physician/loggedin',{username:user_name})
})
})
module.exports=router
这里出什么事了?
回答如下:通常,当您使用给定用户的密码时出现此错误。
更多推荐
与postgres数据库连接时发生验证错误
发布评论