我刚才使用Postgres,我目前正在尝试创建一个新用户。但是,当它要求输入密码时,我输入了我的系统密码,并且身份验证仍然失败。
Alex$ createuser user1
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) n
Shall the new role be allowed to create more new roles? (y/n) n
WARNING: password file "/Users/Alex/.pgpass" has group or world access; permissions should be u=rw (0600) or less
Password:
createuser: could not connect to database postgres: FATAL: password authentication failed for user "Alex"
我知道我正确输入了系统密码。我是否应该使用另一个密码,或者这与世界访问错误有关?
答案 0 :(得分:2)
首先将.pgpass的权限修复为600,然后重试(请参阅此处http://www.postgresql.org/docs/9.1/static/libpq-pgpass.html)您是否应该将用户Alex连接到数据库?