postgresql - pgadmin postgresql - 注册新的本地服务器

标签 postgresql pgadmin

我正在尝试在新的 macbook 上设置 pgAdmin。我正在设置本地服务器,但不断收到错误消息:

连接到服务器时出错:致命:角色“postgres”不存在

这是我的设置:

pgadmin_settings

下面是我的 pg_hba.conf 文件的内容:

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
# IPv6 local connections:
host    all             all             ::1/128                 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     abc1234                                trust
#host    replication     abc1234        127.0.0.1/32            trust
#host    replication     abc1234        ::1/128                 trust
host all all localhost trust
host all all 192.168.1.0/24 trust

有人可以帮忙吗?

提前致谢!

最佳答案

此错误消息告诉您 postgres 角色不存在,它是 postgresql 安装中通常的“ super 用户”。

在这种情况下,似乎已经使用本地用户作为 super 用户安装了集群:

$ ls -ld /usr/local/var/postgres
drwx------ 30 abc1234 admin 1020 May 29 20:46 /usr/local/var/postgres

在这种情况下,我们可能可以使用以下方式登录:

$ psql -U abc1234 postgres

关于postgresql - pgadmin postgresql - 注册新的本地服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37516306/

相关文章:

sql - Dapper:调用 postgres 函数时,字符串作为文本传递

带有 WHERE 子句的 SQL LIMIT

PostgreSQL 在导入 CSV 时将 header 留空

database - 如何使用 Heroku 在 PGAdmin III 上查看用户数据库?

postgresql - 使用 pgAdmin 管理 Cloudfoundy 上的 Postgres 数据库

ruby-on-rails - 使用不同的列处理单表继承

postgresql - 如何从作为表名的变量中选择 n Postgre >=9.2

postgresql - 如何以其他用户身份连接到数据库?

windows-7 - PgAdmin fatal error 。无法联系应用程序服务器

node.js - pgAdmin 中存在 Sequelize 关联,但它在查询期间一直在寻找未知列