1. To get the current postgres version, execute the following command in command prompt.
Example :
cmd: <OpManagerHome>\pgsql\bin>psql.exe --version
Output: psql (PostgreSQL) 9.2.4
2. To change the postgres password follow the steps mentioned below.
- Stop the the OpManager service.
- Connect to the DB by executing the below mentioned commands one by one in command prompt.
<OpManagerHome>\bin\startPgsql.bat
cd <OpManagerHome>\pgsql\bin -> psql -U postgres -h127.0.0.1 -p13306 OpManagerDB
ALTER USER postgres WITH PASSWORD 'new_password';
<OpManagerHome>\bin\stopPgsql.bat
3. Changes to be made in pg_hba.conf
- Under <OpManagerHome>\pgsql\data\pg_hba.conf, change the line as follows. (Highlighted one)
# TYPE DATABASE USER ADDRESS METHOD
# IPv4 local connections:
host all all 127.0.0.1/32 trust
↓
# TYPE DATABASE USER ADDRESS METHOD
# IPv4 local connections:
host all all 127.0.0.1/32 md5
4. To generate encrypted password
- Execute <OpManagerHome>\bin\encryt.bat new_password (encryt.sh new_password - in case of linux)
- Copy the ENCRYPTED_PASSWORD from the batch output for future use.
5. To change the password in database_params.conf
- Open <OpManagerHome>\conf\database_params.conf.
- Alter the line # password postgres → password ENCRYPTED_PASSWORD
6. Restart the OpManager service and connect to the DB Query page or perform any operation related to DB. Check if it is working fine.