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

后端 未结 20 2079
时光说笑
时光说笑 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条回答
  • 2020-12-12 10:23

    First remove the installed postgres:

    sudo apt-get purge postgr*
    sudo apt-get autoremove
    

    Then install 'synaptic':

    sudo apt-get install synaptic
    sudo apt-get update
    

    Then install Postgres

    sudo apt-get install postgresql postgresql-contrib
    
    0 讨论(0)
  • 2020-12-12 10:24

    i make in word by doing this:

    dpkg-reconfigure locales
    

    and choose your preferred locales

    pg_createcluster 9.5 main --start
    

    (9.5 is my version of postgresql)

    /etc/init.d/postgresql start
    

    and then it word!

    sudo su - postgres
    psql
    
    0 讨论(0)
  • 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
    
    0 讨论(0)
  • 2020-12-12 10:26

    Can you check your postgresql.conf file ??

    On what port your postgres is running ??

    I think it is not running on port 5432.If not change it to 5432

    OR on terminal use

    psql -U  postgres -p YOUR_PORT_NUMBER database_name
    
    0 讨论(0)
  • 2020-12-12 10:29

    Try paste in console this:

    $ mkdir /var/pgsql_socket/ 
    
    $ ln -s /private/tmp/.s.PGSQL.5432 /var/pgsql_socket/
    
    0 讨论(0)
  • 2020-12-12 10:29

    A much more simple solution (thanks to http://daniel.fone.net.nz/blog/2014/12/01/fixing-connection-errors-after-upgrading-postgres/) . I had upgraded to postgres 9.4. In my case, all I needed to do (after a day of googling and not succeeding)

    gem uninstall pg
    gem uninstall activerecord-postgresql-adapter
    bundle install
    

    Restart webrick, and done!

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