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.
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 usingyum
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.
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.
verifying the data directory at /var/lib/pgsql and then doing a
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 usingyum
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.