我已经在 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
Run Code Online (Sandbox Code Playgroud)
我还连接到 psql,创建新用户,更改密码并通过运行重新启动服务器sudo systemctl restart postgresql
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------------------+-----------
postgres | Superuser, …Run Code Online (Sandbox Code Playgroud)