【发布时间】:2021-01-24 23:18:15
【问题描述】:
我在 Ubuntu 20.04 上安装了 Postgres 和 PGAdmin4,但我无法创建服务器并连接到数据库
正如我在几个解决方案中看到的,我在我的 pg_hba.conf 文件中将方法更改为 md5
# Database administrative login by Unix domain socket
local all postgres md5
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
我还连接到 psql,创建新用户,更改密码并通过运行 sudo systemctl restart postgresql 重新启动服务器
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------------------+-----------
postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
有什么想法吗?
【问题讨论】:
-
在服务器日志文件中查看完整的错误消息。
标签: postgresql pgadmin