windows安装使用PostgreSQL

最近一个项目要用到pgsql的自定义函数,在windows上安装一个。

下载的是12的版本,
https://get.enterprisedb.com/postgresql/postgresql-12.13-1-windows-x64.exe

刚开始安装后出现问题,看到是杀毒软件影响到了。关闭杀毒软件,重新卸载安装。

为了使用方便,把pg库的bin目录添加到环境变量。

由于是开发,为了使用方便,

修改pg库data目录的pg_hba.conf,把md5修改为trust

host all all 127.0.0.1/32 trust

host all all ::1/128 trust

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

启动服务器:

在命令行启动

pg_ctl.exe reload -N “postgres_12” -D “D:\Program Files\PostgreSQL\12\data”

psql -h 127.0.0.1 -U postgres

关注公众号“大模型全栈程序员”回复“小程序”获取1000个小程序打包源码。更多免费资源在http://www.gitweixin.com/?p=2627

发表评论

邮箱地址不会被公开。 必填项已用*标注