Highlighted
Captain Captain
Captain
373 views

how to check and reset NA postgres password in windows platform 10.30

Dear NA experts ,

 

i want to check and reset NA postgres db password from windows platform 10.30 NA .

kindly provide the suggestion for the same .

we are using NA standalone server with NA postgres database .and we want to upgrade NA and i need password postgres database .

 

Regards,

Rakesh

0 Likes
1 Reply
Highlighted
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

Yes, there is a way to change the superuser password of a postgres database, it would be as follows.

Go to the postgres installation folder and find the file pg_hba.conf, create a copy or a backup of this file changing the name, now, in the file "original" add the line local all all trust, this after the commented lines of the file. (Commented means with # at the beginning).

Now restart your postgres database service.

If the postgres service does not start you must change the added line to the following. host all all 127.0.0.1/32 trust

After these changes you should be able connect with any user of the database as a postgres superuser.

To reset the password you have to connect to the database directly by going to its binaries and using the command psql -U [Database user] here you use the query

ALTER USER [User logged in the database] with password '[New password]';

Now for security it would be ideal to restore the pg_hba.conf file since you should not have access as superuser to any user. After doing this you restart the services again and connect with the changed user of the database.

This in the same way you can look for it in the following links so that you have more references and there are no problems understanding the process to follow.

 

http://www.postgresqltutorial.com/postgresql-reset-password/

https://stackoverflow.com/questions/10845998/i-forgot-the-password-i-entered-during-postgres-installation

http://www.postgresql.org/docs/9.1/static/auth-pg-hba-conf.html

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.