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.

4

1 回答 1

0

改为使用sudo su - postgres。输入 sudo 密码,您将成为 postgres。

于 2013-07-12T18:13:19.477 回答