我最近在Ubuntu上安装了PostgreSQL和EnterpriseDB包。我可以连接到本地数据库,但我不能配置它,因为我找不到配置文件。我搜索了整个硬盘驱动器,只找到了像pg_hba.conf.sample这样的样本
PostgreSQL .conf文件在哪里?
我最近在Ubuntu上安装了PostgreSQL和EnterpriseDB包。我可以连接到本地数据库,但我不能配置它,因为我找不到配置文件。我搜索了整个硬盘驱动器,只找到了像pg_hba.conf.sample这样的样本
PostgreSQL .conf文件在哪里?
当前回答
2022-4-25更新:
地点:/ Library / PostgreSQL / 14 /数据/ postgresql.conf
系统:MacOS Monterey
只是给那些正在寻找这条道路的人……
其他回答
The 30-07-2019
在Windows 10 pro中:
C:\Program Files\PostgreSQL\11\data
Run
sudo updatedb
紧随其后的是
locate postgresql.conf
对于CentOS 6和7以及postgresql 9.2(以及以下版本,我想可能也包括Fedora和Redhat):
/ var / lib / pgsql数据
对于CentOS 6和7 postgresql 9.3或9.4(以及以上版本,我想):
/var/lib/pgsql/9.3/data
/var/lib/pgsql/9.4/data
对于Ubuntu 14和postgresql 9.3:
/etc/postgresql/9.3/main/postgresql.conf
要获得pg_hba.conf文件的位置,还可以像这样查询数据库
SHOW hba_file;
你应该买
hba_file
---------------------------------
/var/lib/pgsql/data/pg_hba.conf
(1 row)
或者问问你的数据库:
$ psql -U postgres -c 'SHOW config_file'
或者,如果以ubuntu用户登录:
$ sudo -u postgres psql -c 'SHOW config_file'