【发布时间】:2019-02-07 13:35:28
【问题描述】:
Postgres 10 安装在 Ubuntu 18.04 沙箱上
如果我使用 Putty SSH 连接到我的机器,我就可以很好地连接到我的数据库。 (VirtualBox 中有 localhost 端口 22 转发)
dangel@ubuntu1804nginx:~$ psql
psql (10.5 (Ubuntu 10.5-0ubuntu0.18.04))
Type "help" for help.
dangel=#
但是,当尝试通过 PGAdmin 或 DataGrip 设置远程连接时,系统会要求我输入数据库用户名和密码...
The specified database user/password combination is rejected:
[08004] The server requested password-based authentication, but no password was provided
我尝试将database 和user 字段留空,并填充它们。一样的。
这让我感到困惑的原因是,我认为通过 SSH 连接,我应该使用ident 身份验证?因此不需要密码? (我没有设置密码)(我知道我一定错过了一个简单的概念,但它是什么?)
编辑: 日志文件条目
2018-09-02 03:57:07.865 UTC [13127] dangel@dangel FATAL: password authentication failed for user "dangel"
2018-09-02 03:57:07.865 UTC [13127] dangel@dangel DETAIL: User "dangel" has no password assigned.
Connection matched pg_hba.conf line 94: "host all all ::1/128 md5"
【问题讨论】:
-
如果您没有更改 root 帐户的密码,或者如果您从未设置过帐户,请使用 Google 的默认 Postgres 登录名。如果它是像 sql 之类的东西,它将是没有密码的 root
标签: postgresql ubuntu ssh pgadmin datagrip