Knex:Error Pool2-错误:用户密码验证失败 [英] Knex:Error Pool2 - error: password authentication failed for user

查看:95
本文介绍了Knex:Error Pool2-错误:用户密码验证失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法顺利迁移到Ubuntu Linux。我可以在终端中使用Postgres。这样我的Postgres密码就不会有问题。

I am having trouble with my migration to Ubuntu Linux. I can use Postgres in the terminal. So I don't have a problem with the Postgres password.

当我键入以下内容时: knex migrate:latest --env development

我得到:

使用环境:开发
Knex:warning-Pool2-错误:池被破坏
Knex :Error Pool2-错误:用户 user的密码身份验证失败


我从相关问题的其他答案中读到pg_hba.conf并将方法设置为信任。我已经做到了,但是没有改变。
我的knex.js文件如下所示:

module.exports = {
开发:{客户端:'pg',
连接: 'postres:// localhost / bikesdb'
},
生产:{
客户端:'pg',
连接:process.env.DATABASE_URL
}
};



我不确定自己做错了什么。

When I type: knex migrate:latest --env development
I get:
Using environment: development Knex:warning - Pool2 - Error: Pool was destroyed Knex:Error Pool2 - error: password authentication failed for user "user"
I've read from other answers in related questions to go into the pg_hba.conf and set the method to trust. I've done this, but no change. my knex.js file looks like this:
module.exports = { devolopment: {client: 'pg', connection: 'postres://localhost/bikesdb' }, production: { client: 'pg', connection: process.env.DATABASE_URL } };
I'm not sure what I'm doing wrong.

推荐答案

您最有可能在节点 6.xx 上运行需要升级您的pg软件包版本 npm install --save pg@4.5.5

You are most likely running on node 6.x.x so you'd need to upgrade your pg package version npm install --save pg@4.5.5

参考:< a href = https://github.com/tgriesser/knex/issues/1371 rel = noreferrer> https://github.com/tgriesser/knex/issues/1371

这篇关于Knex:Error Pool2-错误:用户密码验证失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆