Steps for setting up a password for PgSQL DB

Steps for setting up a password for PgSQL DB

The steps are verified and tested until 12.4.072. 

We request you to take a VM snapshot or a folder backup of the OpManager server itself (stop the OpManager service) as a first measure.

Below mentioned steps are applicable for Postgres version till 9.2.4*

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.
  1. Stop the the OpManager service.
  2. 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
  1. 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
  1. Open <OpManagerHome>\conf\database_params.conf.
  2. 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.

          • Related Articles

          • OpManager DB migration from PGSQL to MSSQL in Version 125230

            For OpManager version 125230: PGSQL to MSSQL Migration Steps : In the PGSQL setup, go to OpManager home → bin, start Command Prompt with administrator privilege from this path and run DBConfiguration.bat. In the popup shown, please chose MSSQL, check ...
          • Admin Password reset in OpM 12

            For users that are authenticated with Active Directory Domain authentication, you can reset the password of an AD user by changing the AD password. The same is applicable for Radius Authenticated users. Local Authenticated users can follow one of the ...
          • OpManager DB migration from PGSQL to MSSQL on the same server in Version 12.3

            Please follow the below mentioned steps to migrate DB from PGSQL to MSSQL on the same server. These steps are applicable only on builds 12.3.045 and above. If you are in older versions below 12.3.045, please upgrade to 12.3.045 and follow these ...
          • Database Migration - MySQL to PgSQL

            The DB migration from MySQL to PgSQL involves taking a PgSQL compatible backup, re-installing the product with PgSQL database and restoring the backup. The procedure for the above is a little tedious and time consuming in version 9 & 10. So, please ...
          • How do I set a password for my OpManager pgsql database ?

            1) Start OpManager service 2)Connect  to OpManager database :   a)Go to OpManager\pgsql\bin folder   b)Type psql -U postgres -h 127.0.0.1 -p13306  OpManagerDB   c)Once connected to the Database, execute the below query to set password          ALTER ...