1.官网下载
zip免安装的过程
下载最新的zip包 http://get.enterprisedb.com/postgresql/postgresql-9.5.2-1-windows-x64-binaries.zip
2.解压到指定路径
将postgresql-9.5.2-1-windows-x64-binaries.zip解压到你想要安装的路径,本文路径是E:\Program Files
3.设置初始数据库、用户名、密码
4.切换到bin目录启动
在pgsql文件夹,你能看到bin目录,点进去,执行初始化命令: initdb -E../data -U postgres
命令的意思是在data文件夹初始化一个数据仓库,用户名设为postgres,密码为空。更多的命令参数使用 initdb --help 查看
初始化完成之后,执行启动命令: postgres -E ../data 进入数据库命令:psql postgres #Alter user postgres password "get";
#CREATE DATABASE guofang_db;
//创建用户名,修改密码,创建数据库,创建表等。
5.配置文件postgresql.conf中"Listen="Localhost"改为Listen="*""
配置文件pg_hba.conf 中 host all all 127.0.0.1/32 md5
添加 host all all 0.0.0.0/0 md5
6.pgAdmin测试连接PostgreSQL数据库