While doing your first PostgreSQL login, Have you got an error like: password authentication failed for user “postgres”.
Relax, No problem !
This is very common error for the user of Linux PostgreSQL.
Here,You can access other related and important articles.
When we install PostgreSQL on Linux, by default, no any password assigns to the Postgres super user.
We should explicitly SET the postgres user password using something like below command.
ubuntu@:~$ sudo passwd postgres
Enter new UNIX password:****
Retype new UNIX password:****
passwd: password updated successfully
Now try to connect using postgres user:
ubuntu@:~$ su postgres
What If I forgot my Postgres user password?
If you forgot your postgres password, you can login without password by changing “md5” to “trust” in pg_hba.conf file and restart the PostgreSQL server.
After login, you can ALTER postgres user:
1 ALTER USER postgres PASSWORD 'MyNewPassword';
Now again change your pg_hba.conf entry from “trust” to “md5” and restart the PostgreSQL server.