0

When I installed the PostgreSQL database server on my Mac, I created the "postgres" account so that it wouldn't have a password:

sudo dscl . -create /Users/postgres Password \*

I thought this would be a good security precaution to take. However, it also prevents me from logging in via the su command so that I can use psql to administer the database:

su - postgres    # <- prompts me for password

I've tried to change the postgres password using the "passwd" and "dscl . -passwd /Users/postgres" commands but they always prompt me for the old password. How do I set the password in this situation?

Thanks.

Jim
  • 13,430
  • 26
  • 104
  • 155
  • This might belong on Super User... if your question gets closed, don't fret. Just go there. – 2rs2ts Jul 12 '13 at 17:56
  • [Probably the same solution as here.](http://stackoverflow.com/questions/11919391/postgresql-error-fatal-role-username-does-not-exist/11919677#11919677) – Erwin Brandstetter Jul 12 '13 at 18:52

1 Answers1

0

Use sudo su - postgres instead. Enter the sudo password, and you'll be postgres.

Denis de Bernardy
  • 75,850
  • 13
  • 131
  • 154