试图在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',你上面列出的不是什么。我是否错过了正确链接路径的内容?感谢您的想法! –