In my Postgres server have created a cluster using the command pg_createcluster listening on port 5433. To set the password for the user postgres I followed the following steps:
- Edit the file nano /etc/postgresql/9.3//pg_hba.conf
Changing the line
host all all 127.0.0.1/32 md5
By line
host all all 127.0.0.1/32 trust
- Change the password using the following commands
sudo -u postgres psql -h localhost -p 5433
postgres = # \ password postgres
Enter new password:
Enter it again:
postgres = # \ q
- Edit the file nano /etc/postgresql/9.3//pg_hba.conf
Changing the line
host all all 127.0.0.1/32 trust
By line
host all all 127.0.0.1/32 md5
Shows no errors but to connect both the console and from the pgadmin3 triggers an error: password authentication failed for user "postgres". With this same process in the instance by default (main) I can connect successfully.
I appreciate any help because I do not find much documentation to work with instances of Postgres. Thanks in advance.