Postgresql 配置文件在哪里:“postgresql.conf”在 Windows 上?
我收到此消息,但找不到 postgresql.conf
文件:
OperationalError: could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "???" and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "???" and accepting
TCP/IP connections on port 5432?
I'm receiving this message but I can't find the postgresql.conf
file:
OperationalError: could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "???" and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "???" and accepting
TCP/IP connections on port 5432?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
在我的机器上:
On my machine:
postgresql.conf
位于PostgreSQL 的数据目录。数据目录是在安装过程中配置的,并且设置保存为c:\Program Files\PostgreSQL\\pg_env.bat
中的PGDATA
条目,例如或者,如果您是超级用户,您可以使用
SHOW config_file;
查询数据库。postgresql.conf
is located in PostgreSQL's data directory. The data directory is configured during the setup and the setting is saved asPGDATA
entry inc:\Program Files\PostgreSQL\<version>\pg_env.bat
, for exampleAlternatively you can query your database with
SHOW config_file;
if you are a superuser.按照这个路径就可以找到
You can find it by following this path
在我的机器上:
On my machine:
你会得到 postgressql.conf 文件
C:/programfiles/postgressql/14/data
您还将获得 pg_hba 来检查用户名密码
you will get postgressql.conf file
C:/programfiles/postgressql/14/data
you will also get the pg_hba to check username password
PGDATA 在 Postgresql 下被假定为 ConfigDir,这在 docker 和正常安装下也有效,这是默认配置,直到没有明确更改。
在我的 docker PGDATA 上配置为“/var/lib/postgresql/data”,因此所有配置都可以在此目录下找到。
PGDATA is assumed as ConfigDir under Postgresql, this works under docker and normal installation as well, this is default configuration until not changed explicitly.
on my docker PGDATA is configure as "/var/lib/postgresql/data" hence all configuration can be found under this directory.
您可以使用以下路径找到 Postgres 全局配置文件:
替换为您已安装的 Postgres 版本。
C:\Program Files\PostgreSQL<版本>\data
这通常是安装时的默认位置。
但是,如果您仍然无法使用路径找到文件,请尝试使用 Windows 中的文件搜索。
You can find your Postgres global config file using the following path:
Replace with the Postgres version you have installed.
C:\Program Files\PostgreSQL<version>\data
This is usually the default location at installation.
However, if you are still unable to locate the file using the path try using file search in Windows.