Connecting to local PostgreSQL started within docker

Hi all,

I set up a local installation with docker [https://github.com/metabrainz/musicbrainz-docker] and like to connect the PostgreSQL-Server obviously running. I found some credentials in the file

./build/musicbrainz/DBDefs.pm

But even the user musicbrainz mentioned there is not connected!

Screenshot_20200901_145540

Ends up with

Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. [SQL State=08001]

Changing host from localhost to 127.0.0.1 doesn’t make it work neither. Can someone tell me how to connect to PostgreSQL please?

Many thanx

Chris

One possible reason could be: https://github.com/metabrainz/musicbrainz-docker#publish-ports-of-all-services

1 Like

Thank you. Almost perfect, now the test-user can connect. How do I get superuser postgres connected? I used login-name postgres and database musicbrainz_db but got The server requested password-based authentication, but no password was provided. [SQL State=08004] on an empty password and FATAL: password authentication failed for user "postgres" [SQL State=28P01] on password postgres.

You can try this one:

2 Likes

Works perfectly fine, thank you!

musicbrainz-docker> psql -h 127.0.0.1 -U musicbrainz -W
Passwort: 
psql (12.4)
Geben Sie »help« für Hilfe ein.

musicbrainz=# \l
                                       Liste der Datenbanken
      Name      | Eigentümer  | Kodierung | Sortierfolge | Zeichentyp |     Zugriffsprivilegien     
----------------+-------------+-----------+--------------+------------+-----------------------------
 musicbrainz    | musicbrainz | UTF8      | en_US.utf8   | en_US.utf8 | 
 musicbrainz_db | musicbrainz | UTF8      | C            | C          | 
 postgres       | musicbrainz | UTF8      | en_US.utf8   | en_US.utf8 | 
 template0      | musicbrainz | UTF8      | en_US.utf8   | en_US.utf8 | =c/musicbrainz             +
                |             |           |              |            | musicbrainz=CTc/musicbrainz
 template1      | musicbrainz | UTF8      | en_US.utf8   | en_US.utf8 | =c/musicbrainz             +
                |             |           |              |            | musicbrainz=CTc/musicbrainz
(5 Zeilen)
2 Likes