Report this

What is the reason for this report?

Newbie to postgresql on Centos 7 and unable to edit the pg_hba.conf due to it asking for postgres password which is unknown

Posted on August 25, 2016

Having problems with postgresql installation on CentOS 7. I uninstalled postgresql, deleted the postgres data directory and reinstalled but now when going through the setup steps to change the pg_hba.conf from indent to md5 it is asking for a postgres password and I did not set it, so I don’t know what it is.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

This question was answered by @ryanpq:

What method did you use to remove PostgreSQL from your droplet? I attempted to duplicate your issue by doing the following on a freshly created CentOS 7 droplet.

yum install postgresql-server 

verifying the data directory at /var/lib/pgsql and then doing a

yum remove postgresql-server

After doing this the data directory was already removed. Having to delete it manually would indicate to me that you may have used a method like rpm -e to remove postgresql-server instead which could preserve your settings. If this is the case, try using yum to remove it again and re-install. This should leave you with a clean installation of PostgreSQL without any of your old configuration (or password) settings remaining.

View the original comment

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.