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

August 25, 2016 181 views
PostgreSQL CentOS

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.

1 comment
  • 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.

Be the first one to answer this question.