pgadminIII mit Datenbank verbinden

Habe eine neue Installation von postgresql 9.5 on linux mint 18. Über die command-line kann ich per “sudo -i -u postgres” und “psql” local auf die Datenbank zugreifen.

Konnekting pgadminIII mit dem lokalen Server resultiert immer in der Fehlermeldung “Fatal: Password authentication failed for user postgres”. Ich habe schon mehrmals mit "postgres=# ALTER USER postgres with password ‘postgres’ versucht das Password zu ändern, immer mit dem gleichen Resultat.

Auch die pq_hda.conf datei habe ich geändert auf “local all all trust”, ohne Erfolg.

Übrigens verweigert libreoffice ebenfalls mit Hinweis auf das Passwort eine Verbindung mit postgresql.

Ich habe das Gefühl etwas einfaches zu übersehen oder zu begreifen. Habe etliche Vorschläge aus dem Internet ausprobiert - ohne Erfolg!

Hat jemand einen tip?

pgadmin wird sich nicht via ‘local’ verbinden (das ist via Unix-Socket), sondern via tcp/ip an localhost oder der lokalen IP. Schaue bitte, was da in der pg_hba.conf steht.

Was genau steht im Log der DB?

Was passiert via psql -h localhost ?

Danke für den Hinweis auf den Verbindungsweg ich werde damit experimentieren. Im Moment bin ich in SW-China bei den Stamm der Yi unterwegs. Aber der Computer ist bei der Hand und die Internet-Verbindung klappt auch.

Die pg_hda.conf sieht so aus (Der Anfang mit den Erklärungen ist gelöscht). Ich habe lediglich mit der ersten Zeile experimentiert nach einer Lösung in einem Forumsbeitrag.

local all postgres trust

TYPE DATABASE USER ADDRESS METHOD

“local” is for Unix domain socket connections only

local all all peer

IPv4 local connections:

host all all 127.0.0.1/32 md5

IPv6 local connections:

host all all ::1/128 md5

Allow replication connections from localhost, by a user with the

replication privilege.

#local replication postgres peer
#host replication postgres 127.0.0.1/32 md5
#host replication postgres ::1/128 md5

Die Log-file zeigt folgendes:
2016-07-26 17:35:04 CST [8927-1] LOG: database system was shut down at 2016-07-26 17:35:03 CST
2016-07-26 17:35:04 CST [8927-2] LOG: MultiXact member wraparound protections are now enabled
2016-07-26 17:35:04 CST [8931-1] LOG: autovacuum launcher started
2016-07-26 17:35:04 CST [8926-1] LOG: database system is ready to accept connections
2016-07-26 17:35:04 CST [8933-1] [unknown]@[unknown] LOG: incomplete startup packet
2016-07-26 17:53:48 CST [9324-1] michael@postgres FATAL: password authentication failed for user “michael”
2016-07-26 17:53:48 CST [9324-2] michael@postgres DETAIL: Connection matched pg_hba.conf line 92: “host all all 127.0.0.1/32 md5”
2016-07-26 17:53:48 CST [9325-1] michael@postgres FATAL: password authentication failed for user “michael”
2016-07-26 17:53:48 CST [9325-2] michael@postgres DETAIL: Connection matched pg_hba.conf line 92: “host all all 127.0.0.1/32 md5”
2016-07-26 17:54:20 CST [9334-1] michael@postgres FATAL: password authentication failed for user “michael”
2016-07-26 17:54:20 CST [9334-2] michael@postgres DETAIL: Connection matched pg_hba.conf line 92: “host all all 127.0.0.1/32 md5”
2016-07-26 17:54:20 CST [9335-1] michael@postgres FATAL: password authentication failed for user “michael”
2016-07-26 17:54:20 CST [9335-2] michael@postgres DETAIL: Connection matched pg_hba.conf line 92: “host all all 127.0.0.1/32 md5”

schaut so aus, als ob das Passwort für den User halt nicht korrekt ist. Ändere mal testweise die Zeile

host all all 127.0.0.1/32 md5

zu

host all all 127.0.0.1/32 trust


dann sollte das gehen.

Leider hat das auch nicht geholfen. Ich habe dann Postgresql entfernt und neu installiert.

Frische Installation mit Fehler psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket “/var/run/postgresql/.s.PGSQL.5432”?. Auf stackoverflow berichtet ein User über das gleiche Problem.

Habe noch einmal neu installiert und bekomme jetzt bei postgres=# conninfo keine Antwort. Immerhin komme ich auf das postgres prompt!

Werde weiter “herumspielen”. Mein Bauchgefühl sagt mir dass ich mit der frischen Linux-Mint 18 und PG 9,5 ein paar Anfangsprobleme gibt die sich hoffentlich legen.