2017-06-20 65 views
2

brew install postgres後:PostgreSQL服務器的本地機器,但PSQL上運行無法連接

brew install postgres 
brew link --overwrite postgresql 

的Postgres已經運行:

/~ $brew services start postgresql 
Service `postgresql` already started, use `brew services restart postgresql` to restart. 

但後來我們如何連接使用psql客戶端?

13:47:28/~ $psql 
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"? 

更新嘗試過各種建議。

嘗試重新啓動..

$brew services start postgresql 
Service `postgresql` already started, use `brew services restart postgresql` to restart. 
14:37:19/fastparquet $brew services restart postgresql 
Stopping `postgresql`... (might take a while) 
==> Successfully stopped `postgresql` (label: homebrew.mxcl.postgresql) 
==> Successfully started `postgresql` (label: homebrew.mxcl.postgresql) 

14:37:39/fastparquet $psql 
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"? 
14:37:55/fastparquet $ 

連接到本地主機?

14:37:34/fastparquet $psql -h localhost 
psql: could not connect to server: Connection refused 
    Is the server running on host "localhost" (::1) and accepting 
    TCP/IP connections on port 5432? 
could not connect to server: Connection refused 
    Is the server running on host "localhost" (127.0.0.1) and accepting 
    TCP/IP connections on port 5432? 
+0

是否'PSQL -h localhost'工作? –

+0

另請參閱:https://stackoverflow.com/q/27700596/330315或https://stackoverflow.com/a/17411832/330315如果您確實**確實Postgres確實在運行 –

+0

Postgres顯然不是運行 –

回答

相關問題