赞
踩
从官网下载PGSQL安装包
选择适合的版本进行下载:
双击安装包
选择合适的路径(一般情况下选择一个自建目录如:$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&
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。