我正在尝试使用Postgres开发一个python应用程序。不幸的是每次我做
db.session.commit()我认为这是个错误:
OperationalError: (OperationalError) fe_sendauth: no password supplied None None在播放pg_hba.config文件之后,我仍然会得到相同的错误。有关文件目前如下:
# Database administrative login by Unix domain socket
local all postgres peer
local all alex trust
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication postgres peer
#host replication postgres 127.0.0.1/32 md5
#host replication postgres ::1/128 md5有人能帮我在Ubuntu14.04上运行这个文件的正确配置吗?
发布于 2016-01-26 20:26:26
很不错的穿行.https://help.ubuntu.com/community/PostgreSQL
首先找到文件pg_hba.config。通常在这里发现:
/etc/postgresql/9.3/main/pg_hba.conf或
/etc/postgresql/[VERSION]/main/pg_hba.conf找到以下注释行:
# Database administrative login by Unix domain socket而在变化之下?到md5:
local all postgres probably 'peer'至:
local all postgres md5这是因为Ubuntu在postgres中使用md5而不是对等身份验证。
然后运行以下命令:
sudo /etc/init.d/postgresql reloadhttps://askubuntu.com/questions/725985
复制相似问题