Postgres.app Could not start on port 5432

后端 未结 24 1048
暗喜
暗喜 2021-01-29 22:24

I\'m using http://postgresapp.com. In the menubar it gives the error \" Could not start on port 5432.\" Similarly if I try to start the server from the terminal, I get:

相关标签:
24条回答
  • 2021-01-29 22:56

    I resolved this problem by

    1. Identifying what was running on port 5432 by using "netstat" in the CL, which was postgreSQL not Postgres
    2. I located the directory that contained postgreSQL, which was root/Library/PostgreSQL
    3. I ensured an instants of the application wasn't running via Activity Monitor
    4. Then I deleted the folder and rebooted! Everything was fine!
    0 讨论(0)
  • 2021-01-29 22:56

    I had the same issues:

    psql: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

    In my case it was a corrupt host file on my mac. I was missing:

    127.0.0.1   localhost
    

    A quick easy way to check is to open terminal and type:

    ping localhost
    

    or:

    scutil -r localhost

    More info here Hope it helps.

    0 讨论(0)
  • 2021-01-29 22:57

    Netstat, ps aux, etc ... none showed 5432 in use. Checked /Library. Found PG9.6 old install still there. Did rm -rf and bang. Version 11 works fine.

    0 讨论(0)
  • 2021-01-29 22:59

    If you've installed Postgres via another method (for example, from www.postgresql.org) and it's starting automatically at startup, you can prevent that Postgres from starting via the following:

    sudo launchctl unload /Library/LaunchDaemons/com.edb.launchd.postgresql-X.X.plist  
    sudo rm -f /Library/LaunchDaemons/com.edb.launchd.postgresql-X.X.plist  
    

    TIP: use tab to autocomplete after the com.edb.launchd part to figure out what version is loading.

    Restart Postgres.app and you should be good to go.

    (from http://forums.enterprisedb.com/posts/list/1831.page;jsessionid=70621DC48C99EDE663A6A594B05F1A02#6782)

    0 讨论(0)
  • 2021-01-29 22:59

    Mine failed to start up suddenly, and when I checked Console.app I saw:

    com.heroku.postgres-service: 
    FATAL:  could not create shared memory segment: Cannot allocate memory
    DETAIL:  Failed system call was shmget(key=5432001, size=3874816, 03600).
    HINT:  This error usually means that PostgreSQL's request for a shared memory segment exceeded available memory or swap space, or exceeded your kernel's SHMALL parameter.  You can either reduce the request size or reconfigure the kernel with larger SHMALL.  To reduce the request size (currently 3874816 bytes), reduce PostgreSQL's shared memory usage, perhaps by reducing shared_buffers or max_connections.
    The PostgreSQL documentation contains more information about shared memory configuration.
    

    It turns out Postgres wouldn't start up because I had Wireshark (and X11) running. It worked fine after I quit Wireshark.

    Good luck!

    0 讨论(0)
  • 2021-01-29 23:01

    beside all the helpful answers, you might also want to take a look at official page instructions : postgressapp.com/documentation/remove.html

    0 讨论(0)
提交回复
热议问题