我最近在Ubuntu上安装了PostgreSQL和EnterpriseDB包。我可以连接到本地数据库,但我不能配置它,因为我找不到配置文件。我搜索了整个硬盘驱动器,只找到了像pg_hba.conf.sample这样的样本
PostgreSQL .conf文件在哪里?
我最近在Ubuntu上安装了PostgreSQL和EnterpriseDB包。我可以连接到本地数据库,但我不能配置它,因为我找不到配置文件。我搜索了整个硬盘驱动器,只找到了像pg_hba.conf.sample这样的样本
PostgreSQL .conf文件在哪里?
当前回答
在CentOS 7和PostgreSQL 9.4中,它在以下目录中:
/var/lib/pgsql/9.4/data
当我以root用户登录时,我可以看到它。
其他回答
在ubuntu中,你可以找到
/etc/postgresql/11/main/pg_hba.conf
// after change restart it otherwise it won't be work
service postgresql restart
The 30-07-2019
在Windows 10 pro中:
C:\Program Files\PostgreSQL\11\data
对于ubuntu 18/20,执行以下命令找到postgresql.conf文件:
locate postgresql.conf
如果你的linux中没有locate,那么先运行sudo apt-get install locate来安装locate。
要获得pg_hba.conf文件的位置,还可以像这样查询数据库
SHOW hba_file;
你应该买
hba_file
---------------------------------
/var/lib/pgsql/data/pg_hba.conf
(1 row)
我把它定位在这里:
/var/lib/pgsql/9.6/data/postgresql.conf