欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 教育 > 培训 > postgres12基础配置

postgres12基础配置

2025/10/14 4:56:30 来源:https://blog.csdn.net/lwprain/article/details/144322252  浏览:    关键词:postgres12基础配置

一、前提
下载:
第一步
https://www.enterprisedb.com/downloads/postgres-postgresql-downloads
具体地址
https://get.enterprisedb.com/postgresql/postgresql-12.22-1-windows-x64.exe
安装位置为:
D:\wamp\PostgreSQL\12
数据库位置:
D:\wamp\PostgreSQL\12\data
注意:
不要在postgres中直接安装pgadmin,最好是单独下载。
windows版下载:
https://www.pgadmin.org/download/pgadmin-4-windows/
具体地址:
https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v8.13/windows/pgadmin4-8.13-x64.exe
二、配置:
1、远程连接
在data目录,即:
D:\wamp\PostgreSQL\12\data
中编辑 pg_hba.conf
增加远程连接:
原始的最后二行:

host    replication     all             127.0.0.1/32            md5
host    replication     all             ::1/128                 md5

增加一行:

host all all 0.0.0.0/0 md5

2、修改最大连接数
找到 postgresql.conf
修改:
max_connections配置
原始:

port = 5432				# (change requires restart)
max_connections = 100			# (change requires restart)

修改为:

port = 5432				# (change requires restart)
max_connections = 5000			# (change requires restart)

修改wal_keep_segments配置:
原始:

#wal_keep_segments = 0		# in logfile segments; 0 disables

修改为:

wal_keep_segments = 3		# in logfile segments; 0 disables

3、重启服务即可。

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词