Tuesday, June 23, 2015

FATAL: password authentication failed for user "your-user-idl"

The following steps work for a fresh install of postgres 9.4 on Ubuntu 14.04

By default, postgres creates a user named 'postgres'. We log in as that user, and give that user a password.

$ sudo -u postgres psql
\password
Enter password: topseckret

\q

to exit postgres.

Then we connect as 'postgres'. The -h localhost part is important: it tells the psql client that we wish to connect using a TCP connection (which is configured to use password authentication), and not by a PEER connection (which does not care about the password).

$ psql -U postgres -h localhost