我最近在Ubuntu上安装了PostgreSQL和EnterpriseDB包。我可以连接到本地数据库,但我不能配置它,因为我找不到配置文件。我搜索了整个硬盘驱动器,只找到了像pg_hba.conf.sample这样的样本
PostgreSQL .conf文件在哪里?
我最近在Ubuntu上安装了PostgreSQL和EnterpriseDB包。我可以连接到本地数据库,但我不能配置它,因为我找不到配置文件。我搜索了整个硬盘驱动器,只找到了像pg_hba.conf.sample这样的样本
PostgreSQL .conf文件在哪里?
当前回答
在ubuntu中,你可以找到
/etc/postgresql/11/main/pg_hba.conf
// after change restart it otherwise it won't be work
service postgresql restart
其他回答
因为我没有访问postgres帐户(所以不能运行SHOW config_file),我的postgres安装在Windows上,没有一个答案对我有帮助,所以我把我的文件位置分享给未来的Windows读者:
C:\Program Files\PostgreSQL\9.5\data
在Mac上(使用brew安装Postgres):
/usr/local/Cellar/postgresql/9.3.3>bin/postgres -D /usr/local/var/postgres/
在ubuntu中,你可以找到
/etc/postgresql/11/main/pg_hba.conf
// after change restart it otherwise it won't be work
service postgresql restart
Ubuntu 13.04使用软件中心安装:
我的位置是:
/etc/postgresql/9.1/main/postgresql.conf
在CentOS 7和PostgreSQL 9.4中,它在以下目录中:
/var/lib/pgsql/9.4/data
当我以root用户登录时,我可以看到它。