WAS THIS PAGE HELPFUL? Leave Feedback
Overview
Follow the steps below to reset your PostgreSQL root user password.
This process will disrupt access to your system. |
During this process, if you received the message No such file or directory, you may need to enter the following command which puts it on the path for environment variables, this is necessary once per shell session: source /usr/local/groundwork/scripts/setenv.sh |
Steps
- Stop gwservices:
/etc/init.d/groundwork stop gwservices
- Stop httpd:
/etc/init.d/groundwork stop apache
- Update the the following file to trust for local connections:
vi /usr/local/groundwork/postgresql/data/pg_hba.conf
Example:
# TYPE DATABASE USER ADDRESS METHOD host all all 127.0.0.1/32 trust
- Restart postgres:
/etc/init.d/groundwork restart postgresql
- Open a psql session as the postgres user (you won't be asked for the password under TRUST authentication) to the database:
psql
- Execute the command (leave quotes):
ALTER USER postgres WITH PASSWORD '<newpassword>';
- Leave the session:
\q
- Undo the settings to trust in the file:
vi /usr/local/groundwork/postgresql/data/pg_hba.conf
Example:
# TYPE DATABASE USER ADDRESS METHOD host all all 127.0.0.1/32 md5
- Restart gwservices:
/etc/init.d/groundwork restart gwservices
- Restart httpd:
/etc/init.d/groundwork restart apache
- Restart postgres:
/etc/init.d/groundwork restart postgresql
- You should now be able to connect using the new password, you can test by entering psql.