环境
windows 10
电脑必须有网
版本:postgresql-12.16-1-windows-x64
必须把所有的postgres数据库删除干净(比如注册表,数据目录)
pg12官网地址:https://sbp.enterprisedb.com/getfile.jsp?fileid=1258665
#################
bat批处理解说:直连官网下载pg12包,一键部署pg数据库-教程
下载pg12包-保存路径:"D:\pg_bags\postgresql-12.16-1-windows-x64.exe
pg12安装目录: "D:\pg\PostgreSQL\12
##############################
pg12默认数据库用户:postgres
pg12默认数据库用户密码:postgres
################################################
pg12.bat 代码如下:
@echo off
chcp 65001 > nul
echo 创建目标安装目录
mkdir "D:\pg\PostgreSQL\12"
mkdir "D:\pg_bags"
timeout /t 6
chcp 65001 > nul