当前位置:   article > 正文

windows下安装PGSQL14_pg14数据库windows安装包

pg14数据库windows安装包

从官网下载PGSQL安装

PostgreSQL: Downloads

 

 选择适合的版本进行下载:

双击安装包

选择合适的路径(一般情况下选择一个自建目录如:$PGSQL\)

若不想安装多余的可以仅安装PGSQL server 端 不安装其他的(建议安装命令行工具)

 然后下一步设置密码

设置PGSQL的网络端口

然后设置语言(我选择的是默认语言)

然后下一步直到安装开始

若不想使用默认的工具可以不勾选

修改配置文件

在PGSQL数据库的根目录下:*:\PGSQL\PostgreSQL\14\data\postgresql.conf

修改以下配置参数:

listen_addresses = '*'                # what IP address(es) to listen on;
                                                  # comma-separated list of addresses;
                                                  # defaults to 'localhost'; use '*' for all
                                                  # (change requires restart)
port = 5432                                # (change requires restart)
max_connections = 100            # (change requires restart)

------------------------------------------------------------------------------------------------------

# This is used when logging to stderr:
logging_collector = on                # Enable capturing of stderr and csvlog
                                                   # into log files. Required to be on for
                                                   # csvlogs.
                                                   # (change requires restart)

                                                   # These are only used if logging_collector is on:
log_directory = 'log'                    # directory where log files are written,

 log_truncate_on_rotation = on        # If on, an existing log file with the
                                                         # same name as the new log file will be
                                                         # truncated rather than appended to.
                                                         # But such truncation only occurs on
                                                         # time-driven rotation, not on restarts
                                                         # or size-driven rotation.  Default is
                                                         # off, meaning append to existing files
                                                         # in all cases.

-------------------------------------------------------------------------------------------------------

修改配置文件:*:\PGSQL\PostgreSQL\14\data\pg_hba.conf

添加以下内容

host all all 0.0.0.0/0 md5        //或者host all all 0.0.0.0/0 scram-sha-256     -----允许所有机器远程访问

--------------------------------------------------------------------------------------------------------------------------

启动和关闭PGSQL&

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/410405
推荐阅读
相关标签
  

闽ICP备14008679号