Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to add a new user as follows:

sudo -u postgres createuser -D -A -P onemoreadmin

I am entering the password right.

Then, I get the following error:

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"?
share|improve this question

migrated from Oct 11 '12 at 7:56

This question came from our site for professional and enthusiast programmers.

try with below code

sudo -u postgres createuser -D -A -P onemoreadmin -h localhost

-h --> hostname

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.