PostgreSQL won't start anymore

40,152

Solution 1

PostgreSQL is having an error on startup and to find out what it is you will have to start PostgreSQL manually. PostgreSQL does not log its startup failures as often as you would hope and how i find out what is going on is by starting a cmd.exe window under the postgres user and manually starting PostgreSQL.

Run this to start a CMD.exe under the postgres user

runas /user:postgres cmd.exe

Enter in the postgres password. And then in that new CMD window start PostgreSQL

"C:/Program Files (x86)/PostgreSQL/8.3/bin/postgres.exe" -D "C:/Program Files (x86)/PostgreSQL/8.3/data"

And let us know the output...

Solution 2

I had the same problem. The reason was, that there were incorrect rights set to the folder. I mean, I manually created a data folder and PostgreSQL service wasn't started. When I copied my data folder content to the original data folder (the one created by PostgreSQL during the installation) everything worked properly.

Solution 3

I had this kind of issue when installing and old versión on a MS Server 2019.

I verified that the Postgre's service wasn't being able to start. I had to locate the installation directory and change the permissions, give "Modify" permission to an specific user that may be having this issue. In case of a windows service, the the "Network Service" user.

As a test, you can give Modify permissions to "Authentificated Users" to verify that's the cause and later on try to look for the specific user.

In my case, it was a very custom installation and the service was registered to "Network Service" user.

I'm not sure if on typical or other installations the running user may change

Share:
40,152

Related videos on Youtube

Sander Declerck
Author by

Sander Declerck

Updated on September 18, 2022

Comments

  • Sander Declerck
    Sander Declerck over 1 year

    Today, my PostgreSQL doesn't start anymore on my windows machine...

    I've tried to start the service in windows services and got the following error:

    Windows could not start the PostgreSQL Database Server 8.3 service on Local Computer.
    
    Error 1053: The service did not respond to the start or control request in a timely fashion.
    

    Then I went to the command line to manually start C:/Program Files (x86)/PostgreSQL/8.3/bin/psql.exe, and then I got this error:

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

    Edit: I found this in the logs:

    2011-04-22 13:13:16 CEST LOG:  could not receive data from client: No connection could be made because the target machine actively refused it.
    
    
    2011-04-22 13:13:16 CEST LOG:  unexpected EOF on client connection
    
    • Eelke
      Eelke about 13 years
      Can you look in your postgresql log files and post any relevant message. Log files are located in the pg_log subdirectory of your postgres data folder. Which is probably c:\program files (x86)\postgresql\8.3\data
    • Milen A. Radev
      Milen A. Radev about 13 years
      Also take a look at the event log.
    • Sander Declerck
      Sander Declerck about 13 years
      I editted my post with the information I found in the logs...
    • gravyface
      gravyface about 13 years
      Can you run netstat -aon | find "5432" and see if any other processes are running on that port?
  • vpzomtrrfrt
    vpzomtrrfrt over 6 years
    How would I know this password? I don't remember setting one up.