Recover/reset PostgreSQL password

By | 16 April, 2012

Ran into some PostgreSQL problems again (what else is new?), this time regarding the password for the windows user postgres creates.

I was replacing postgreSQL x64 for the x86 version to fix some weborb/php/lots of other stuff problems. I uninstalled my x64 version, it left the data folder and user, and when it was reinstalling, it asked for my password. I thought i knew it (i still think i do, but lets assume it was me who forgot it and not postgres), but the setup wouyldnt accept it no matter what.

Anyway, to make things short, to reset the password, you can do this:

– Open a Command Prompt with Admin permissions

– type net user postgres postgres (the abstract syntax is “net user [USER HERE] [PASSWORD HERE]”)

– the password is reset to “postgres”

– Smile.