Commands I ran.
podman run --name internet-archive -p 5432:5432 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=secret -d postgres:12-alpine
podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
65f84e3684cd docker.io/library/postgres:12-alpine postgres 33 minutes ago Up 33 minutes 0.0.0.0:5432->5432/tcp internet-archive
podman exec -it internet-archive createdb --username=root --owner=root crawler
podman start internet-archive
I attempt to conect:
psql -h localhost -p 5432 -U root -d crawler
I get prompted for password. I input it carefully, I get:
‘psql: error: connection to server at “localhost” (::1), port 5432 failed: FATAL: password authentication failed for user “root”‘
I run the following command to check the rules:
podman exec -it internet-archive cat /var/lib/postgresql/data/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 all trust
host replication all 127.0.0.1/32 trust
host replication all ::1/128 trust
3