Customer Service Center
Spirent KB Article
Doc ID: FAQ18706
Email Article Link
Spirent TestCenter: How to change "postgres" user password on PostgreSQL if I forgot it?
To change the PostgreSQL database admin account, which is also called "postgres" account, you have to do the following:
Edit file “pg_hba.conf ” located at:
and set the localhost method (Both IPv4 and IPv6 local connections) to
instead of md5. Do not forget to save.
Open up Services manager and restart
will not ask any password when run it in the command prompt.
Open up a command prompt and go to Postgres Bin directory: "
On that location, execute Postgres using the following command:
"psql.exe -U postgres -h localhost"
and hit enter.
Use the following SQL command to set the postgres user password, replacing "
" text for the desired password:
ALTER USER postgres WITH PASSWORD 'new_password';
and hit enter.
NOTE that your new password has to be written between simple quotations as it is showed on image below
If the instruction was correctly applied, you will receive the message "
" which is confirming that the postgres password has been changed
Revert the pg_hba.conf localhost method (Both IPv4 and IPv6 local connections) back to md5.
service in Services manager.
From this point you can confirm if the password was successfully changed executing again psql in the command line, now you will be prompted to type your current postgres password
Product : Windows GUI