... WAS THIS PAGE HELPFUL? {html}<a href="mailto:training@gwos.com?subject=How to reset PostgreSQL password">Leave Feedback</a>{html}\\ \\ h5. Overview Follow the steps below to reset your PostgreSQL root user password.
|
{note}This process will disrupt access to your system.{note} {tip}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{}}}{tip}
|
{{{*}source /usr/local/groundwork/scripts/setenv.sh{*}}}{tip}
|
h5. Steps
|
... # Stop gwservices: {noformat}/etc/init.d/groundwork stop gwservices{noformat} # Stop httpd: {noformat}/etc/init.d/groundwork stop apache{noformat} # Update the the following file to trust for local connections: {noformat}vi /usr/local/groundwork/postgresql/data/pg_hba.conf{noformat} Example: {noformat}# TYPE DATABASE USER ADDRESS METHOD host all all 127.0.0.1/32 trust{noformat} # Restart postgres: {noformat}/etc/init.d/groundwork restart postgresql{noformat} # Open a {{psql}} session as the {{postgres}} user (you won't be asked for the password under TRUST authentication) to the database: {noformat}psql{noformat} # Execute the command (leave quotes): {noformat}ALTER USER postgres WITH PASSWORD '<newpassword>';{noformat} # Leave the session: {noformat}\q{noformat} # Undo the settings to trust in the file: {noformat}vi /usr/local/groundwork/postgresql/data/pg_hba.conf{noformat} Example: {noformat}# TYPE DATABASE USER ADDRESS METHOD host all all 127.0.0.1/32 md5{noformat} # Restart gwservices: {noformat}/etc/init.d/groundwork restart gwservices{noformat} # Restart httpd: {noformat}/etc/init.d/groundwork restart apache{noformat} # Restart postgres: {noformat}/etc/init.d/groundwork restart postgresql{noformat} # You should now be able to connect using the new password, you can test by entering {{psql}}.
|