0

On OS X 10.11.2, I've installed Postgres.app and I'm running the local server. I'm trying to create a local account with a username and password so that I can develop a Rails app locally. However, running the following command:

sudo -u postgres createuser -s {USERNAME}

I receive sudo: unknown user: postgres error.

Any suggestions as to why this error occurs and how to resolve this?

2 Answers 2

2

sudo tells you there is no system user "postgres".

When you installed PostgreSQL, it should have created database user "postgres" and you can try use that:

$ psql -u postgres
postgres=# create user {username} password '{password}';
Sign up to request clarification or add additional context in comments.

Comments

0

I managed to create a user with the following steps.

In the terminal:

createuser --superuser {USERNAME}

I then set a password in psql:

\password {USERNAME}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.