1

我使用以下命令在上安装了

sudo pacman -S postgresql

它安装正常。但是当我想创建一个新用户时,像这样:

sudo -iu postgres
[postgres@amirashabani ~]$ createuser amirashabani

我收到此错误:

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 "/run/postgresql/.s.PGSQL.5432"?

我怎样才能解决这个问题?

4

1 回答 1

0

问题是我忘记了ArchWikistart中提到enable服务:

最后,启动启用postgresql.service。

这样做之后:

systemctl start postgresql.service
systemctl enable postgresql.service 

一切正常。

于 2019-06-27T05:57:25.853 回答