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:\pgsql\data -E UTF-8 –locale=chs -U postgres -W

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

pg_ctl register -N PostgreSQL -D c:\pgsql\data

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

springboot -> fhadmin.cn

6.1 notepad c:\pgsql\data\postgresql.conf

设置:listen_addresses = ‘*’

6.2 notepad c:\pgsql\data\pg_hba.conf

置ipv4段

host all all 0.0.0.0/0 md5

7、启动服务

net start PostgreSQL

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

netsh firewall set opmode disable

本作品采用《CC 协议》,转载必须注明作者和本文链接
讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!
未填写
文章
234
粉丝
11
喜欢
34
收藏
35
排名:794
访问:8710
私信
所有博文
社区赞助商