2016-07-01 4 views
1

Ich habe vor kurzem die grafische Installation für Postgresql 9.4 auf meinem Mac heruntergeladen und ging durch die gesamte Einrichtung, sogar ein Passwort gemacht, aber wenn es um die Shell zu aktivieren kein Passwort funktionieren würde. Ich habe mein Systempasswort und das, das ich eingestellt habe, ausprobiert, aber keiner hat funktioniert.Failed Passwort Authentifizierung für Benutzer 'Postgres' auf dem Mac

Jedesmal, wenn ich

sudo -u postgres psql 

Ich erhalte den Fehler

psql: FATAL: password authentication failed for user "postgres"

Dies ist meine Datei pg_hba.conf

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 Allow replication connections from localhost, by a user with the replication privilege. local replication postgres md5 host replication postgres 127.0.0.1/32 md5

+0

Versuchen Sie Ihr eigenes u ser Passwort. – robertklep

Antwort

0

Versuchen Sie psql Passwort ändern
in conf Datei lokal ändern:
local all all trust
Restart psql Server:
sudo /etc/init.d/postgresql restart
Connect als Superuser postgres:
sudo -u postgres psql
Passwort ändern:
ALTER USER postgres PASSWORD 'newpassword';
ändern zurück Ihre conf-Datei:
local all all md5
Restart psql Server:
sudo /etc/init.d/postgresql restart

Verwandte Themen