最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

与postgres数据库连接时发生验证错误

网站源码admin21浏览0评论

与postgres数据库连接时发生验证错误

与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

这里出什么事了?

回答如下:

通常,当您使用给定用户的密码时出现此错误。

发布评论

评论列表(0)

  1. 暂无评论