如何解决准备konga数据库时创建与Postgresql的连接时出错
在安装Konga之后,我们尝试在已经运行的Postgresql数据库上准备Konga数据库。通过使用建议的命令,即
node ./bin/konga.js prepare --adapter postgres --uri postgresql://localhost:5432/konga
但是我们面临如下错误:
Error creating a connection to Postgresql using the following settings:
postgresql://localhost:5432/konga?host=localhost&port=5432&schema=true&ssl=false&adapter=sails-postgresql&user=postgres&password=XXXX&database=konga_database&identity=postgres
* * *
Complete error details:
error: password authentication Failed for user "root"
error: A hook (`orm`) Failed to load!
error: Failed to prepare database: error: password authentication Failed for user "root"
我们甚至手动创建了架构konga_database,并尝试了几种准备命令的变体,但没有成功
node ./bin/konga.js prepare --adapter postgres --uri postgresql://kong:XXXX@localhost:5432/konga_database
node ./bin/konga.js prepare --adapter postgres --uri postgresql://kong@localhost:5432/konga
node ./bin/konga.js prepare --adapter postgres --uri postgresql://kong@localhost:5432/konga_database
下面是config / connections.js
postgres: {
adapter: 'sails-postgresql',url: process.env.DB_URI,host: process.env.DB_HOST || 'localhost',user: process.env.DB_USER || 'postgres',password: process.env.DB_PASSWORD || 'XXXX',port: process.env.DB_PORT || 5432,database: process.env.DB_DATABASE ||'konga_database',// schema: process.env.DB_PG_SCHEMA ||'public',// poolSize: process.env.DB_POOLSIZE || 10,ssl: process.env.DB_SSL ? true : false // If set,assume it's true
},
下面是.env文件配置
PORT=1337
NODE_ENV=production
KONGA_HOOK_TIMEOUT=120000
DB_ADAPTER=postgres
DB_URI=postgresql://localhost:5432/konga
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=XXXX
KONGA_LOG_LEVEL=info
TOKEN_SECRET=
kong和postgresql已经在各自端口(即8443和5432)的AWS linux AMI 2服务器上运行了
请帮助我们准备数据库并启动konga服务。也。如果您需要更多信息,请告诉我们。
Node v: v12.19.0
NPM v: 6.14.8
问候 尼丁G
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。