File 正在设置PostgreSQL,无法连接到数据库postgres

File 正在设置PostgreSQL,无法连接到数据库postgres,file,postgresql,directory,File,Postgresql,Directory,我将使用postgreSQL 9.2在Debian 7上创建一个django应用程序。 我在数字海洋中创造了一个水滴。我更新并升级了系统。 我使用了以下命令 sudo aptitude install postgresql postgresql-contrib 安装postgresql 当我将用户更改为postgres,并希望使用createuser-p 我填写了它想要的所有字段,但它出现了以下错误: createuser: could not connect to database post

我将使用postgreSQL 9.2在Debian 7上创建一个django应用程序。 我在数字海洋中创造了一个水滴。我更新并升级了系统。 我使用了以下命令

sudo aptitude install postgresql postgresql-contrib
安装postgresql

当我将用户更改为postgres,并希望使用
createuser-p

我填写了它想要的所有字段,但它出现了以下错误:

createuser: 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"?
我在Ubuntu12.04和Debian7中尝试了几次同样的过程

我该怎么办? 我想使用Debian 7,所以我更喜欢使用Debian的解决方案。 我对这方面还不熟悉,所以请解释一下。
谢谢。

我解决了语言环境问题,重新安装了PostgreSQL

第一:

第二:

设置区域设置并对postgreSQL进行干净的安装


谢谢

您是否尝试使用
initdb
创建postgres DB集群?我应该如何做?:)使用postgres手册:或者只需谷歌
postgres initdb
谢谢。“服务器是否在本地运行并在Unix域套接字上接受连接…”