PostgreSQL不提示输入密码 [英] Postgresql does not prompt for password

查看:87
本文介绍了PostgreSQL不提示输入密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Linux机器上设置了一个postgresql 8.3 db,以及一个用户postgrespg_hba.conf读取

I have a postgresql 8.3 db set up on linux box, together with a user postgres The pg_hba.conf reads

local   all         postgres                          ident sameuser
local   all         all                               md5

因此没有来自本地计算机的可信连接.

so no trusted connections from local machine.

但是,通过命令行与psql连接时,无需输入密码,所有用户都可以访问所有数据库.

Yet when connecting via commandline with psql, no password is asked and all users get all access to all databases.

我在这里完全迷路了.

推荐答案

确定要在更改pg_hba.conf后重新启动或重新加载PostgreSQL吗?

Are you sure you did restart or reload of PostgreSQL after pg_hba.conf change?

如果是,请从postgres系统帐户(shell)中键入以下命令:

If yes, type this command from postgres system account (shell):

psql -qAt -c "show hba_file" | xargs grep -v -E '^[[:space:]]*#'

如果这样做没有帮助-向我们显示命令的输出.

If this will not help - show us output of the command.

这篇关于PostgreSQL不提示输入密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆