Postgresql在Windows下的解压安装
1.将下载的压缩包解压,我是解压在D:\postgreSQL\pgsql中。
2.设置环境变量如下:
set PGHOME=D:\postgreSQL\pgsql
set PGDATA=%PGHOME%\data
set PGLIB=%PGHOME%\lib
set PGHOST=localhost
set PATH=%PGHOME%\bin;%PATH%
3.创建数据库,利用pgsql\bin目录下的initdb.exe命令,我用的格式如下:
|
1
|
initdb --locale=CHS -E UTF8 -D "myPostgre" -U postgre –W postgre |
如果对命令不熟悉可以用如下的命令进行初始化,最后一个参数是自己创建的数据目录:
initdb.exe -U postgres -W --locale=C -E UTF8 -D C:\Users\user\Desktop\Hadoop\pgsql\data
|
1
|
关于initdb的详细参数,可以用initdb --help来查看。 |
|
1
|
若是执行成功,有如下log信息: |
creating directory postgre ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 32MB
creating configuration files ... ok
creating template1 database in postgre/base/1 ... ok
initializing pg_authid ... ok
Enter new superuser password:
Enter it again:
setting password ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok
上面红色的地方需要输入数据库超级用户的密码。
4.成功安装后,在windows中添加用户 postgre,该用户就是之前在initdb命令中-U 后的用户名。
5.启动数据库和停止数据库的命令为:
|
1
2
|
pg_ctl -D "myPostgre" startpg_ctl -D "myPostgre" stop |
|
1
|
然后就可以开始postgresql的学习之旅了:)。 |
|
1
|
我也是刚开始学习postgresql,主要是想利用其空间数据库的功能来完成一些GIS方面的应用。 |
|
1
|
希望能和大家多交流交流,同时能得到高手的指教! |
原文地址:https://www.cnblogs.com/wang_yb/archive/2010/04/25/1720787.html
Postgresql在Windows下的解压安装的更多相关文章
- windows下MySQL解压版安装
MySQL的安装 一.前期准备 获取MySQL解压版安装包(本文使用的是 [mysql-5.7.28-winx64.zip]版本) 获取方式: 通过官网下载,官方下载地址:“https://dev.m ...
- windows下mysql解压版安装及centos下mysql root密码忘记
windows安装 1. 下载zip版的解压后将bin添加到path. 2. 修改解压目录D:\mysql\mysql-5.7.12-winx64下的my.ini,设置路径: 还要添加 [client ...
- Windows下自动解压windows share上的文件
rem mkdir c:\buildmd c:\build rem Mount the Windows share to Z drivenet use x: \\172.16.10.240\Infa_ ...
- Windows解压安装mysql 5.7.24,并部署多个mysql服务
mysql官网windows安装文档 https://dev.mysql.com/doc/refman/5.7/en/windows-installation.html 第一步,选择安装包 htt ...
- (5)分布式下的爬虫Scrapy应该如何做-windows下的redis的安装与配置
软件版本: redis-2.4.6-setup-64-bit.exe — Redis 2.4.6 Windows Setup (64-bit) 系统: win7 64bit 本篇的内容是为了给分布式下 ...
- 【Redis】windows下redis服务的安装
下载地址: https://github.com/MicrosoftArchive/redis/releases Redis 支持 32 位和 64 位.这个需要根据你系统平台的实际情况选择,这里我们 ...
- windows下,下载pip安装
windows下,下载pip安装 https://pypi.python.org/pypi/pip#downloads 找到source那个压缩文件,下载下来解压. 参考: windows下面安装Py ...
- Lua在Windows下的配置、安装、运行
Windows下安装.运行Lua! 本文提供全流程,中文翻译.Chinar坚持将简单的生活方式,带给世人!(拥有更好的阅读体验 -- 高分辨率用户请根据需求调整网页缩放比例) 1↓ 进入Lua官网:h ...
- mysql zip 解压安装
系统:win10 专业版 mysql 5.7.21 解压安装. 对于Windows,mysql官网推荐使用可执行文件进行安装,这里我还是暂时用noinstall 解压zip文件来安装 zip 文件解压 ...
随机推荐
- Leetcode题目39.组合总和(回溯+剪枝-中等)
题目描述: 给定一个无重复元素的数组 candidates 和一个目标数 target ,找出 candidates 中所有可以使数字和为 target 的组合. candidates 中的数字可以无 ...
- mybatis中添加时间字符串条件
<if test="operatorDateStart != null and operatorDateStart !='' " >operator_date > ...
- cast()、decimal(M,D) --SQL对查询字段保留小数位操作
参考:http://database.51cto.com/art/201005/201651.htm http://www.lai18.com/content/1693593.html 直接上例子,以 ...
- Unity通过世界坐标系转换到界面坐标位置
public static Vector2 WorldToCanvasPoint(Canvas canvas, Vector3 worldPos) { Vector2 pos; RectTransfo ...
- koa 项目实战(八)生成token
1.安装模块 npm install jsonwebtoken --save 2.引用 const jwt = require('jsonwebtoken'); ... // 返回token cons ...
- GC垃圾回收 | 深入理解G1垃圾收集器和GC日志
来源:并发编程网链接:http://ifeve.com/深入理解G1垃圾收集器/ G1 GC是Jdk7的新特性之一.Jdk7+版本都可以自主配置G1作为JVM GC选项:作为JVM GC算法的一次重大 ...
- 语法错误 : 缺少“;”(在“<”的前面)
该错误有可能是由错误所指行“<”附近的某个类型忘记#include <>所造成的
- Ubuntu14.04+安卓系统4.3+JDK6编译源码
本博客主要参照: https://www.jianshu.com/p/ecb9c132030f https://blog.csdn.net/gobitan/article/details/243674 ...
- RTSP协议-中文定义
RTSP协议-中文定义 转自:http://blog.csdn.net/arau_sh/article/details/2982914 E-mail:bryanj@163.com 译者: Bryan. ...
- vue项目报错
在项目根目录下的.eslintrc.js中的rules下添加以下内容: /*代表不用eslint检测代码规范*/ "useEslint":false, /* tab和空格混用缩进, ...