无法在 Ubuntu 15.10 添加 PgAdmin 新连接

Cannot Add PgAdmin New Connection on Ubuntu 15.10

从 Ubuntu 软件中心安装 pgAdmin III 后,我打开它,它需要添加到服务器的连接。所以我填写了如下信息:

单击“确定”按钮后,显示错误消息

Error connecting to the server: could not translate host name "http://127.0.0.1" to address: Name or service not known

如消息所示,我认为 postgres 服务没有启动。因此,我继续进入终端控制台并通过输入 sudo service postgresql start 启动服务,但它返回 Failed to start postgresql.service: Unit postgresql.service failed to load: No such file or directory. 。我的 pgAdmin III 有什么问题或缺失?我之前只用过 Ubuntu,在 windows 上从来没有遇到过这个问题。谢谢。

http://127.0.0.1 更像是一个 URL,该字段正在寻找主机,因此只需删除 http:// 以保留本地主机的 IP 地址 127.0.0.1 或键入 localhost 如果它解析为正确的地址(通常应该通过 /etc/hosts 或类似的地址)

此外,Debian/Ubuntu 倾向于单独运送数据库服务器。对于 Ubuntu,postgresql 包(需要 postgresql-common)包应该包含 /lib/systemd/system/postgresql.service 因此你应该能够 sudo systemctl start postgresql

您是否安装了 postgresql(相对于 postgresql-client)?