試圖在OSX Mountain Lion上設置Postgres/PostGIS以與Django一起使用。然而,有些事情是錯誤的,我不知道如何解決它。Postgres數據庫本地安裝/運行
$ createdb geo
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/pgsql_socket/.s.PGSQL.5432"?
$ postgres -D /usr/local/var/postgres
FATAL: lock file "postmaster.pid" already exists
HINT: Is another postmaster (PID 221) running in data directory "/usr/local/var/postgres"?
$ pg_ctl -D /usr/local/var/postgres -l logfile start
pg_ctl: another server might be running; trying to start server anyway
server starting
然後,我發現this gist說,如何解決它在獅子。然而,它並沒有爲我工作:
$ kill -9 221
$ pg_ctl -D /usr/local/var/postgres stop
waiting for server to shut down.... done
server stopped
$ pg_ctl -D /usr/local/var/postgres start
pg_ctl: another server might be running; trying to start server anyway
server starting
FATAL: lock file "postmaster.pid" already exists
HINT: Is another postmaster (PID 1436) running in data directory "/usr/local/var/postgres"?
的另一種嘗試:
$ cd /usr/local/var/postgres
$ mv postmaster.pid postmaster.backup
$ pg_ctl -D /usr/local/var/postgres start
server starting
$ LOG: could not bind IPv6 socket: Address already in use
HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
LOG: could not bind IPv4 socket: Address already in use
HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
LOG: could not bind IPv6 socket: Address already in use
HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
WARNING: could not create listen socket for "localhost"
FATAL: could not create any TCP/IP sockets
有沒有人成功地做到了這一點與美洲獅?如果是這樣,我錯過了什麼?感謝您對此問題的幫助!
感謝您的想法@Daniel。我使用自制軟件安裝了PostGRE,並按照[說明](http://pageworthy.com/blog/postgis-on-mountain-lion/)進行操作。你對如何解決這個問題有任何想法,以便我可以在django項目中使用我的PostGREs數據庫?感謝您的想法! –
@NickB:查看更新 –
謝謝@Daniel。我跟着從鏈接後的指令,並把'USR /本地/ bin'以上'USR/bin',但是當我嘗試'這createdb'它輸出'在/ usr/bin中/ createdb',你上面列出的不是什麼。我是否錯過了正確鏈接路徑的內容?感謝您的想法! –