PostgreSQL 在windows 配置

发布时间:2022-06-08 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了PostgreSQL 在windows 配置脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

PostgreSQL支持windows10。

具体的安装方法如下:

1、下载

32位:get.enterprisedb.com/postgresql/postgresql-10.3-1-windows-binaries.zip

64位:get.enterprisedb.com/postgresql/postgresql-10.3-1-windows-x64-binaries.zip

2、解压到:c:pgsql

3、设置环境变量(cmd):

setx PGHOME c:pgsql
setx PGHOST localhost
setx PGLIB %PGHOME%lib
setx PGDATA %PGHOME%data
setx Path "%Path%;%PGHOME%bin"

重新登录

4、初始化数据库

initdb.exe -D c:pgsqldata -E UTF-8 --locale=chs -U postgres -W

5、注册为系统服务(以管理员权限打开cmd)

pg_ctl register -N PostgreSQL -D c:pgsqldata

6、修改配置以支持远 程连接

springboot ->  fhadmin.cn

6.1 notepad c:pgsqldatapostgresql.conf

设置:listen_addresses = '*' 

6.2 notepad c:pgsqldatapg_hba.conf

置ipv4段

   host    all    all    0.0.0.0/0    md5

7、启动服务

net start PostgreSQL

8、关闭防火墙(视情况而定)

netsh firewall set opmode disable

 

脚本宝典总结

以上是脚本宝典为你收集整理的PostgreSQL 在windows 配置全部内容,希望文章能够帮你解决PostgreSQL 在windows 配置所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签:数据库