1

I am on Windows 10 using WAMP, I added PostgreSQL and PhpPgAdmin, everything was working fine. Today I can not log in to PostgreSQL through PhpPgAdmin or a php_pdo web app.

I tried editing pg_hba.conf in 2 locations c:\PostgreSQL\pg96\init\ and c:\PostgreSQL\data\pg96\ and changed the 'method' to trust as per many answers here, none of the CLI answers worked either.

I also restarted "WAMP" and even the whole computer, but no luck.

The default password worked before postgres and root but not now.

How do I reset the postgre password?

UPDATE

runing psql -U postgres returns;

psql: could not connect to server: Connection refused (0x0000274D/10061)
    Is the server running on host "localhost" (::1) and accepting
    TCP/IP connections on port 5432?
could not connect to server: Connection refused (0x0000274D/10061)
    Is the server running on host "localhost" (127.0.0.1) and accepting
    TCP/IP connections on port 5432?

contents of pg_hba.conf

# TYPE  DATABASE        USER            CIDR-ADDRESS            METHOD

# IPv4 local & remote connections:
host    all             all             127.0.0.1/32            trust
host    all             all             0.0.0.0/0               trust
# IPv6 local connections:
host    all             all             ::1/128                 trust
Chad
  • 1,139
  • 17
  • 41

1 Answers1

0

so after a lot more diging, it was not that the password was wrong, but for whatever reason PostgreSQL was not even running. Windows is such a PITA!

in the end, running pg_ctl -D "C:\PostgreSQL\data\pg96" start from CMD got it going. Now we will see if it starts tomorrow.... I miss my Unix Environment.

----- UPDATE -----

While the above code works, it is moving in the wrong direction. goto Control Panel->Administrative Tools->Services and find 'PostgreSQL ...' in the list. Right click and open Properties.

My Startup type: was set to 'Automatic' but it was not starting, I set it to 'Automatic (Delayed Start)' and now it is working, automagically!

Chad
  • 1,139
  • 17
  • 41