尝试为ror应用设置postgres,出现错误-fe_sendauth:未提供密码 [英] Trying to set up postgres for ror app, getting error - fe_sendauth: no password supplied
问题描述
获取:
An error has occurred:
Error connecting to the server: fe_sendauth: no password supplied
database.yml
中的设置与其他计算机上的应用程序设置相同.
Settings in database.yml
are the same as the app setup on other machines.
我该如何设置以便不需要硬编码的密码?
How can I set things up so that I don't need a password hardcoded?
我可以使用PgAdmin-III查看数据库.
I can view the db ok using PgAdmin-III.
我宁愿在database.yml
中没有密码,因为使用此应用程序的其他计算机不需要/不需要密码,因此似乎与我的Pg安装有关.
I'd rather not have the password in database.yml
as other machines using this app don't have/need it, so it seems likely to be something about my Pg install.
推荐答案
您需要更改您的pg_hba.conf
更改.这是我的一个例子:
You need to change your change your pg_hba.conf
. Here's an example of mine:
pg_hba.conf
:
TYPE DATABASE USER ADDRESS METHOD
host all all 127.0.0.1/32 trust
host all PC 127.0.0.1/32 trust
host all all ::1/128 trust
请注意,trust
表示address
上的任何人(在这种情况下为localhost)可以以列出的用户身份(或在这种情况下,其选择的任何用户)进行连接.这实际上仅适用于数据不重要的开发配置. 请勿在生产环境中使用此功能.
Note that trust
means that anyone on address
(in this case localhost) can connect as the listed user (or in this case any user of their choice). This is really only suitable for development configurations with unimportant data. Do not use this in production.
这篇关于尝试为ror应用设置postgres,出现错误-fe_sendauth:未提供密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!