Socket File “/var/pgsql_socket/.s.PGSQL.5432” Missing In Mountain Lion (OS X Server)

后端 未结 20 2158
时光说笑
时光说笑 2020-12-12 09:48

I just upgraded my MacMini Server from Lion Server to Mountain Lion using OS X Server. I am having the same problem with PostgreSQL that I did last year when I first instal

20条回答
  •  猫巷女王i
    2020-12-12 10:24

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

    I kept on getting the above error and none of the above solutions worked for me. Finally the following solution solved my problem on Mac OS X

    Install postgres using brew

    brew install postgres
    

    Install brew services

    brew tap homebrew/services
    

    To start postgres as a background service

    brew services start postgresql
    

    To stop postgres manually

    brew services stop postgresql
    

    We can also use brew services to restart Postgres

    brew services restart postgresql
    

提交回复
热议问题