gpt4 book ai didi

ruby-on-rails - 创建用户 : could not connect to database postgres in Rails app?

转载 作者:行者123 更新时间:2023-11-29 13:06:00 25 4
gpt4 key购买 nike

我是 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"

我知道我输入的系统密码是正确的。是否有我应该使用的另一个密码,或者这是否与世界访问错误有关?

最佳答案

首先将 .pgpass 的权限设置为 600,然后重试(参见此处 http://www.postgresql.org/docs/9.1/static/libpq-pgpass.html)是否应该与用户 Alex 连接到数据库?

关于ruby-on-rails - 创建用户 : could not connect to database postgres in Rails app?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12219995/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com