gpt4 book ai didi

node.js - 耐克斯 :Error Pool2 - error: password authentication failed for user "username" (Not using UNIX account)

转载 作者:行者123 更新时间:2023-11-29 13:52:11 25 4
gpt4 key购买 nike

问题出现在以下命令中:

knex --knexfile config/db/knexfile.js migrate:latest

我收到以下错误:

Knex:warning - Pool2 - Error: Pool was destroyed
Knex:Error Pool2 - error: password authentication failed for user "dennis"
Knex:Error Pool2 - error: password authentication failed for user "dennis"
Error: Pool was destroyed
at Pool._destroyPool (/home/dennis/projects/amgen-sites/data-api/node_modules/pool2/lib/pool.js:560:20)
at Pool.<anonymous> (/home/dennis/projects/amgen-sites/data-api/node_modules/pool2/lib/pool.js:474:18)
at Pool.<anonymous> (/home/dennis/projects/amgen-sites/data-api/node_modules/pool2/lib/pool.js:517:17)
at tryCatcher (/home/dennis/projects/amgen-sites/data-api/node_modules/knex/node_modules/bluebird/js/release/util.js:16:23)
at Promise.errorAdapter [as _rejectionHandler0] (/home/dennis/projects/amgen-sites/data-api/node_modules/knex/node_modules/bluebird/js/release/nodeify.js:35:34)
at Promise._settlePromise (/home/dennis/projects/amgen-sites/data-api/node_modules/knex/node_modules/bluebird/js/release/promise.js:558:21)
at Promise._settlePromise0 (/home/dennis/projects/amgen-sites/data-api/node_modules/knex/node_modules/bluebird/js/release/promise.js:606:10)
at Promise._settlePromises (/home/dennis/projects/amgen-sites/data-api/node_modules/knex/node_modules/bluebird/js/release/promise.js:681:18)
at Async._drainQueue (/home/dennis/projects/amgen-sites/data-api/node_modules/knex/node_modules/bluebird/js/release/async.js:138:16)
at Async._drainQueues (/home/dennis/projects/amgen-sites/data-api/node_modules/knex/node_modules/bluebird/js/release/async.js:148:10)
at Immediate.Async.drainQueues (/home/dennis/projects/amgen-sites/data-api/node_modules/knex/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:570:20)
at tryOnImmediate (timers.js:550:5)
at processImmediate [as _immediateCallback] (timers.js:529:5)

它似乎没有使用我的 UNIX 帐户,而是尝试使用用户名/密码进行身份验证。

我尝试了以下解决方案:

  • 更新pg到最新
  • knex更新到最新
  • 替换要信任的方法:

    # IPv4 local connections: host all all 127.0.0.1/32 信任

  • 将连接字符串从[db name]替换为[postgres://[db name]:

    connection: {
    database: 'postgres://data-api-dev',
    user: '',
    password: ''
    },

如何让它使用我的 UNIX 帐户?

我在 Ubuntu 16.04 上使用 Node v6.3.1。

这是我安装的包:

├── bluebird@2.10.2
├── body-parser@1.15.2
├── bookshelf@0.10.0
├── chai@3.5.0
├── chai-as-promised@5.3.0
├── colors@1.1.2
├── convict@1.4.0
├── cors@2.7.1
├── express@4.14.0
├── gulp@4.0.0-alpha.2 (git://github.com/gulpjs/gulp.git#d8f5c90a0622d19ef1943a2a3d02dc50e3c853e7)
├── gulp-exit@0.0.2
├── gulp-mocha@2.2.0
├── gulp-nodemon@2.1.0
├── gulp-using@0.1.0
├── jsonwebtoken@5.7.0
├── knex@0.11.10
├── lodash@3.10.1
├── pg@6.1.0
├── request-promise@0.4.3
├── sinon@1.17.5
├── sinon-as-promised@4.0.2
├── sinon-chai@2.8.0
├── supertest@1.2.0
└── validator@4.9.0

最佳答案

事实证明,将方法从 md5 重命名为 trust 是正确的解决方案。修改后忘记重启postgresql服务,所以第一次没有成功。

关于node.js - 耐克斯 :Error Pool2 - error: password authentication failed for user "username" (Not using UNIX account),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39060780/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com