【发布时间】:2018-10-08 05:34:39
【问题描述】:
LoopBack:我正在尝试使用此数据源通过 CentOS 中的数据源文件将我的数据库连接到 API:
{
"db": {
"name": "db",
"connector": "memory"
},
"apidb": {
"host": "localhost",
"port": 5432,
"url": "postgres://postgres@localhost/apidb",
"database": "apidb",
"password": "",
"name": "apidb",
"user": "postgres",
"connector": "postgresql"
}
}
我尝试了多次连接,但出现错误:
Web server listening at: http://localhost:3000
Browse your REST API at http://localhost:3000/explorer
Connection fails: error: Ident authentication failed for user "postgres"
It will be retried for the next request.
events.js:183
throw er; // Unhandled 'error' event
^
error: Ident authentication failed for user "postgres"
当我输入su - postgres 时,我可以毫无问题地进入 bash。我有一个要连接的数据库名称apidb。到目前为止我试过了:
- 正在删除密码密钥。
- 修复不同结构的url(例如:postgres://postgres:@localhost:5432/apidb
- 结果here。 pg install 正在更新的位置。
以下是数据库在列出时的样子:
apidb| postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres
+
| | | | | postgres=CTc/po
stgres +
我不确定错误来自何处。帮助!
【问题讨论】:
标签: node.js angular postgresql loopback