我最近在Ubuntu上安装了PostgreSQL和EnterpriseDB包。我可以连接到本地数据库,但我不能配置它,因为我找不到配置文件。我搜索了整个硬盘驱动器,只找到了像pg_hba.conf.sample这样的样本
PostgreSQL .conf文件在哪里?
我最近在Ubuntu上安装了PostgreSQL和EnterpriseDB包。我可以连接到本地数据库,但我不能配置它,因为我找不到配置文件。我搜索了整个硬盘驱动器,只找到了像pg_hba.conf.sample这样的样本
PostgreSQL .conf文件在哪里?
当前回答
在Mac OS X上:
sudo find / -name postgresql.conf
您可以通过下面的命令找到其他的conf文件:
sudo find / -name pg\*.conf
注:参见用法using man:
man find
其他回答
在Mac OS X上:
sudo find / -name postgresql.conf
您可以通过下面的命令找到其他的conf文件:
sudo find / -name pg\*.conf
注:参见用法using man:
man find
要获得pg_hba.conf文件的位置,还可以像这样查询数据库
SHOW hba_file;
你应该买
hba_file
---------------------------------
/var/lib/pgsql/data/pg_hba.conf
(1 row)
对于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
Ubuntu 13.04使用软件中心安装:
我的位置是:
/etc/postgresql/9.1/main/postgresql.conf
The 30-07-2019
在Windows 10 pro中:
C:\Program Files\PostgreSQL\11\data