postgresql pg_hba.conf 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10695109/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
pg_hba.conf file
提问by user1233418
Can somebody please post an original copy of an unedited pg_hba.conf file for postgresql, 9.1, on ubuntu. I screwed it up and can't find an original nor in the position to reinstall.Thank you
有人可以在 ubuntu 上为 postgresql 9.1 发布未经编辑的 pg_hba.conf 文件的原始副本。我搞砸了,找不到原件,也无法重新安装。谢谢
采纳答案by gahcep
In fact, the only way you can receive this file is when somebody else will run initdbon his machine and send the file to you by email or via some hosting.
事实上,您可以接收此文件的唯一方法是其他人在他的机器上运行initdb并通过电子邮件或某些主机将文件发送给您。
The officialway is (documentation says):
在官方的方法是(文档说):
Client authentication is controlled by a configuration file, which traditionally is named pg_hba.conf and is stored in the database cluster's data directory. A default pg_hba.conf file is installed when the data directory is initialized by initdb. It is possible to place the authentication configuration file elsewhere, however; see the hba_file configuration parameter.
客户端身份验证由配置文件控制,该文件传统上名为 pg_hba.conf 并存储在数据库集群的数据目录中。一个在数据目录由initdb的初始化安装缺省的文件。但是,可以将身份验证配置文件放在其他地方;请参阅 hba_file 配置参数。
UPDATE:Is this pg_hba.conf(pastebin.com) what you was looking for? It's the file I received right now when installed a PostgreSQL 9.1 on Debian 6.
更新:是这样的pg_hba.conf(pastebin.com)你在找什么?这是我在 Debian 6 上安装 PostgreSQL 9.1 时收到的文件。
回答by Eelke
I don't have Ubuntu at hand but in most cases there are three rules (all the rest is just comments). On most distributions the method is set to ident.
我手头没有 Ubuntu,但在大多数情况下,有三个规则(其余的只是评论)。在大多数发行版中,该方法设置为 ident。
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all ident
# IPv4 local connections:
host all all 127.0.0.1/32 ident
# IPv6 local connections:
host all all ::1/128 ident
回答by Eelke
Can't you run initdb again to create a new database cluster which would have a new pg_hba.conf?
你不能再次运行 initdb 来创建一个新的数据库集群,它会有一个新的 pg_hba.conf 吗?