我安装了 postgresql 和(我认为)pyscopg2。我想用 django 运行 postgresql。我尝试了命令“createdb mydb”,得到了如下所示的错误消息。我应该怎么办?
无法连接到数据库 postgres:
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"?
我正在运行 mac osx 10.8.2。
当我输入时,ps auwwx|grep postg
我得到:
robbie 27589 0.0 0.0 2443176 1528 ?? Ss 7:25am 0:00.01 postgres: autovacuum launcher process
robbie 27588 0.0 0.0 2443044 552 ?? Ss 7:25am 0:00.01 postgres: wal writer process
robbie 27587 0.0 0.0 2443044 592 ?? Ss 7:25am 0:00.16 postgres: writer process
robbie 27586 0.0 0.0 2443044 612 ?? Ss 7:25am 0:00.00 postgres: checkpointer process
robbie 27584 0.0 0.1 2443044 3524 ?? S 7:25am 0:00.02 /usr/local/opt/postgresql/bin/postgres -D /usr/local/var/postgres -r /usr/local/var/postgres/server.log
robbie 27626 0.0 0.0 2423572 24 s000 S+ 7:36am 0:00.00 grep postg
robbie 27590 0.0 0.0 2439324 444 ?? Ss 7:25am 0:00.01 postgres: stats collector process
当我输入时psql -V I
得到: psql (PostgreSQL) 9.1.4
当我输入时,which psql
我得到:/usr/bin/psql