Database 在ubuntu上激活postgres时出现错误;无法连接到数据库postgres“;

Database 在ubuntu上激活postgres时出现错误;无法连接到数据库postgres“;,database,postgresql,ubuntu,Database,Postgresql,Ubuntu,当我在windows笔记本电脑上安装Ubuntu 13.10时,我试图激活postgres。 我转到终端,运行以下命令 sudo apt-get install postgresql sudo passwd postgres Enter new UNIX password: 123123 Retype new UNIX password: 123123 sudo -u postgres createuser -P db_owner Enter password for new role: 123

当我在windows笔记本电脑上安装Ubuntu 13.10时,我试图激活postgres。 我转到终端,运行以下命令

sudo apt-get install postgresql
sudo passwd postgres
Enter new UNIX password: 123123
Retype new UNIX password: 123123
sudo -u postgres createuser -P db_owner
Enter password for new role: 123123
Enter it again: 123123
Shall the new role be a superuser? (y/n) y
然后终端给了我以下错误:

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"?

请注意,这是一个新安装的Ubuntu 13.10,我还没有在上面做任何事情,这是我第一次使用Ubuntu

我不知道Ubuntu(或者Linux),但是
install postgresql
是否也初始化了数据目录(使用
initdb
)?如果没有,那么Postgres就不能运行了,你需要手动操作:谢谢你,但我试过了,但没有用。我正在寻找一个逐步的操作手册,因为我从来没有在askubuntu.com上使用过Ubuntu