Psql Socket Error
Contents |
log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site
Psql: Could Not Connect To Server: No Such File Or Directory Ubuntu
About Us Learn more about Stack Overflow the company Business Learn more about postgres could not connect to server connection refused hiring developers or posting ads with us Database Administrators Questions Tags Users Badges Unanswered Ask Question _ Database Administrators Stack psql could not connect to server is the server running locally and accepting Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute: Sign up
How To Start Postgres Server
Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top PostgreSQL is running locally but I cannot connect. Why? up vote 26 down vote favorite 18 Recently updated my machine from Mac OS X Lion (10.7.4) to Mountain Lion (10.8) and I think it borked my PostgreSQL installation. It was installed originally via
Could Not Connect To Server Connection Refused Is The Server Running On Host Localhost
Homebrew. I'm not a DBA, but hoping someone can tell me how to troubleshoot this. I am unable to connect (but was able to before pre-Mountain Lion): $ psql -U rails -d myapp_development 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"? But Postgres is still clearly running: $ ps aux | grep postgres meltemi 2010 0.0 0.0 2444124 5292 ?? Ss Wed01PM 0:00.02 postgres: rails myapp_development [local] idle meltemi 562 0.0 0.0 2439312 592 ?? Ss Wed12PM 0:02.28 postgres: stats collector process meltemi 561 0.0 0.0 2443228 1832 ?? Ss Wed12PM 0:01.57 postgres: autovacuum launcher process meltemi 560 0.0 0.0 2443096 596 ?? Ss Wed12PM 0:02.89 postgres: wal writer process meltemi 559 0.0 0.0 2443096 1072 ?? Ss Wed12PM 0:04.01 postgres: writer process meltemi 466 0.0 0.0 2443096 3728 ?? S Wed12PM 0:00.85 /usr/local/bin/postgres -D /usr/local/varpostgres -r /usr/local/var/postgres/server.log And it's responding to queries (both to a test db and the development db) from a local Rails app User Load (0.2ms) SELECT "users".* FROM "users" Rendered users/index.html.haml within layouts/application (1.3ms) There appears to be no /var/pgsql_socket/ directory, let alone the /var/pgsql_socket/.s.PGSQL.5432 so
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and psql could not connect to server connection refused windows policies of this site About Us Learn more about Stack Overflow the
Psql Could Not Connect To Server Connection Refused Ubuntu
company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users connections on unix domain socket /tmp/.s.pgsql.5432 mac Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes http://dba.stackexchange.com/questions/21587/postgresql-is-running-locally-but-i-cannot-connect-why a minute: Sign up Socket File “/var/pgsql_socket/.s.PGSQL.5432” Missing In Mountain Lion (OS X Server) up vote 73 down vote favorite 38 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 installed Lion Server. When I try to do http://stackoverflow.com/questions/13868730/socket-file-var-pgsql-socket-s-pgsql-5432-missing-in-mountain-lion-os-x-ser any kind of PostgreSQL terminal command I get the following notorious error message that many have gotten over the years: 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 was attempting to change the password for _postgres when I got the error. I tried several commands but got the same error. I just rebooted my server but no luck. I logged in as root to look at /var/pgsql_socket and the folder is empty. Folder /var/pgsql_socket_alt is also empty. I have checked online about this. However just about all of the solutions I have read, including on Stack Overflow, suggest a removal and reinstall of PostgreSQL. I do not know but this does not seem like a plausible option because several options on the Server App use PostgreSQL. I contacted Apple Enterprise Support (no agreement) and I was told that my issue would have to be solved by the developers which would cast $695. I have a website that is down right now because I cannot rebu
Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the http://serverfault.com/questions/641329/cannot-connect-to-postgresql-unix-domain-socket company Business Learn more about hiring developers or posting ads with us Server Fault Questions Tags Users Badges Unanswered Ask Question _ Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Cannot connect to PostgreSQL unix domain socket could not up vote 5 down vote favorite I'm trying to connect to PostgreSQL Unix domain socket from a PHP web application. Relevant system components: CentOS 7 x64 (SELinux enforced) postgresql93 9.3.5-2PGDG.rhel7 nginx 1.6.2-1.el7.ngx php-common 5.4.16-23.el7_0.3 php-fpm 5.4.16-23.el7_0.3 php-pdo 5.4.16-23.el7_0.3 php-pgsql 5.4.16-23.el7_0.3 PostgreSQL is listening on standard port 5432 and I have no problems to use it via TCP/IP at 127.0.0.1:5432, but when I try to connect to its Unix domain socket, I have a following could not connect error: Cannot connect to database: SQLSTATE[08006] [7] 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"? File /tmp/.s.PGSQL.5432 exists and I can connect using psql: $ psql -Uusername db_name psql (9.3.5) Type "help" for help. db_name=> So there should be no problems from the PostgreSQL side. Or are there? Relevant line from /var/lib/pgsql/9.3/data/pg_hba.conf: local all username trust Change of location for Unix domain socket file in /var/lib/pgsql/9.3/data/postgresql.conf did not help: unix_socket_directories = '/var/run/pgsql' There was nothing in /var/log/audit/audit.log, but I've tried to disable SELinux, just to be sure: # setenforce 0 This did not help, so it is not SELinux. Relevant lines from strace of php-fpm: [pid 882] socket(PF_LOCAL, SOCK_STREAM, 0) = 5 [pid 882] fcntl(5, F_SETFL, O_RDONLY|O_NONBLOCK) = 0 [pid 882] fcntl(5, F_SETFD, FD_CLOEXEC) = 0 [pid 882] connect(5, {sa_family=AF_LOCAL, sun_path="/tmp/.s.PGSQL.5432"}, 110) = -1 ENOENT (No such file or directory) [pid 882] close(5) = 0 The file name is correct and, again, file /tmp/.s.PGSQL.5432 exists: $ ls -l /tmp/.s.PGSQL.5432 srwxrwxrwx. 1 postgres postgres 0 Nov 1 09:47 /tmp/.s.PGSQL.5432 It looks like php-fpm process is not chroot'ed: # ls -l /proc/882/root lrwxrwxrwx. 1 apache apache 0 Oct 31 19:54 /proc/882/root -> / At this point I have no more ideas where the problem can be