1

My Postgres installation won't allow me to connect remotely. I set the listen_addresses field in the postgresql.conf to '*' and added the line

host    all             all             0.0.0.0/0               md5

to pg_hba.conf, restarted the database and tried

psql dbname uname -h 127.0.0.1 

I always get

Password authentication failed for user "uname"

(also when just setting

host    all             all             127.0.0.1/32               md5

in hba or testing from a remote host).

I can't find any more configurations or suggestions to fix this. I'm running PostgreSQL 9.4 on Ubuntu 15.04 (installed from the repository). Has anyone a suggestion on what to try next? Or am I missing something?

  • did you try to connect to this remote database using pgadmin – hacene abdessamed May 17 '16 at 13:30
  • 1
    Wrong password? Not connecting to the database you think you are? – Craig Ringer May 17 '16 at 14:21
  • @haceneabdessamed pgadmin gives me the same error: Password authentication failed for user "uname" – SakeSushiBig May 17 '16 at 14:22
  • @CraigRinger I can connect locally with the database with the same user and password (using pgsql dbname uname on the houst where postgres runs), I have the according rule in pg_hba.conf local all all md5 – SakeSushiBig May 17 '16 at 14:23
  • Does psql ask for the password on the terminal or do you get the error message without any interaction? – Daniel Vérité May 17 '16 at 17:59
0

Okay ... Upon installation of postgres another service was using the port 5432 so postgres took 5434. I didn't notice. Works now

  • Probably a previous Postgres instance had already taken 5432 (and another the 5433) port. – ypercubeᵀᴹ May 18 '16 at 10:03
  • Yeah, some docker container exposing to this port, running another postgres instance. I just would have never assumed that it changes the standard port upon installation. I thought it would rather fail on startup! I know it is documented, but well ... – SakeSushiBig May 18 '16 at 10:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.