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.
Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.
If you like this post, then please share it with others.
Please follow dbrnd.com, I will share my experience towards the success of Database Research and Development Activity.
I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.