2013-10-13 134 views
0

我下載了postgresql-9.1。postgresql命令沒有執行

,但是當我在終端執行以下命令:

$ createdb mydb 

我得到以下信息:

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

請告訴我如何排序這個疑難問題,甚至試圖卸載,然後重新安裝它。我試圖在linux mint 15(肉桂)上運行這個。

+0

你碰巧看過文檔嗎? http://www.postgresql.org/docs/9.1/static/server-start.html – bma

回答

0

使用ps來查看postgresql進程是否實際運行。如果沒有,請啓動它(service postgresql start)。通常應該在安裝後自行啓動,但誰知道。此外,某些錯誤可能會阻止它在啓動時啓動。

如果postgresql正在運行,那麼您可能需要在數據目錄中編輯pg_hba.conf。同樣,通常數據庫應該默認偵聽本地連接,但是誰知道。