我使用以下命令在postgresql上安装了archlinux:
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"?
我该如何解决?
答案 0 :(得分:0)
问题是我忘记了postgresql中提到的start
和enable
ArchWiki服务:
这样做之后:
systemctl start postgresql.service
systemctl enable postgresql.service
一切正常。