我正在尝试添加新用户,如下所示:
sudo -u postgres createuser -D -A -P onemoreadmin
我输入的密码正确。
然后,我收到以下错误:
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/pgsql_socket/.s.PGSQL.5432"?
答案1
尝试下面的代码
sudo -u postgres createuser -D -A -P onemoreadmin -h localhost
-h --> 主机名