Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 stackoverflow.com Oct 11 '12 at 7:56

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

add comment

1 Answer

try with below code

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

-h --> hostname

share|improve this answer
add comment

Your Answer

 
discard

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.