Postgresql 无法连接到数据库postgres

Postgresql 无法连接到数据库postgres,postgresql,Postgresql,我正试图在ubuntu服务器18.04上安装dspace 6.3,但在安装postgresql之后,当我运行命令createuser-U postgres-d-A-p dspace时,我得到了上面的错误帮助,请你启动服务器了吗?尝试sudo-service-postgrestart或sudo-systemctl-restart-postgresql您已经启动了pgsql后台程序?请确认postmaster进程已启动且仍在运行(尝试ps-ef | grep postmaster)。此外,您可能需要

我正试图在ubuntu服务器18.04上安装dspace 6.3,但在安装postgresql之后,当我运行命令
createuser-U postgres-d-A-p dspace
时,我得到了上面的错误帮助,请你启动服务器了吗?尝试
sudo-service-postgrestart
sudo-systemctl-restart-postgresql

您已经启动了pgsql后台程序?请确认
postmaster
进程已启动且仍在运行(尝试
ps-ef | grep postmaster
)。此外,您可能需要检查日志,查看postgres是否打印了任何错误
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"?