Change Postgres password

Sam
edited May 2013 in General
I just did a clean install on a newly formatted Windows 2012 server. Things seemed to go fine until I received an error that it couldn't connect to the database. It appears as if the Postgres password is not working. How can I either change that, or just do a clean install (since I haven't changed the base install)?

Comments

  • Hi Sam,

    To reset the PostgreSQL user 'postgres', you would:

    * Edit the "pg_hba.conf"
    * Change the "password" text at the end of the "local connections" lines for both IPv4 and IPv6 to "trust"
    * Restart the "EventSentry Database" service.
    * You can now connect in pgAdmin III with the postgres user and no password.
    * Expand the server and Login Roles.
    * Right click the "postgres" user and choose Properties...*
    * Click the "Definition" tab, and set the new password.
    * Be sure to put the pg.hba.conf lines back to "password" instead of "trust" and restart database service again.

    If you just need to reset the users 'eventsentry_svc or eventsentry_web', you would:

    * Connect to pgAdmin III with the postgres user and password
    * Expand the server and Login Roles.
    * Right click on the 'eventsentry_svc or eventsentry_web' user and choose Properties...
    * Click the "Definition" tab, and set the new password.

    Steven
  • Hi Sam,

    Quick correction, you should use "md5" instead of "password" in the pg_hba.conf file since it is more secure.

    Tames
  • Thank you both -- I was able to get the postgres password resolved. I'm not sure what went wrong, and where, but when I go in to check on the eventsentry_svc and eventsentry_web users, they don't exist, at least not in the same 'login roles' area as the postgres user. And the reason I checked is because I do get an error (password authentication failed for user eventsentry_svc at SQLconnect) when trying to deploy the client to another computer (although it does appear to install after I clear the error message).
  • HI Sam,

    In the EventSentry management console, can you click the 'Initialize or Update Database' button in your database action. This will launch the EventSentry Configuration Assistant which should add those two user account into PostgreSQL for you. If that doesn't work, could you please let me know.

    Steven
  • Sorry for the delayed response--other issues to deal with. I've made progress, but am still getting this error (repeatedly, now that I've enabled email notifications...).

    EVENT # 44859
    EVENT LOG Application
    EVENT TYPE Error
    OPCODE Info
    SOURCE PostgreSQL
    EVENT ID 0
    COMPUTERNAME SA-SENTRY
    DATE / TIME 5/22/2013 9:05:56 AM
    MESSAGE FATAL: password authentication failed for user "eventsentry_svc"

    I've tried resetting the password again, but the message remains.

    On the "Primary Database" screen, the "Connection String" appears to have the correct Uid (eventsentry_svc) and the same password that I used.

    Sam
  • HI Sam,

    When you reset the eventsentry_svc password last time, did you change it in your EventSentry database action and push the configuration out to all your remote machines?

    Steven
  • Thanks for the response! I only pushed the updated configuration to clients this morning, so maybe that was the step I had missed. It's only been a few minutes, but the above mentioned error seems to have subsided.
Sign In or Register to comment.