zoukankan      html  css  js  c++  java
  • 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命令,我用的格式如下:

    initdb --locale=CHS -E UTF8 -D "myPostgre" -U postgre –W postgre
    关于initdb的详细参数,可以用initdb --help来查看。
    若是执行成功,有如下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.启动数据库和停止数据库的命令为:

    pg_ctl -D "myPostgre" start
    pg_ctl -D "myPostgre" stop 
    然后就可以开始postgresql的学习之旅了:)。
    我也是刚开始学习postgresql,主要是想利用其空间数据库的功能来完成一些GIS方面的应用。
    希望能和大家多交流交流,同时能得到高手的指教!
  • 相关阅读:
    pywin32解析office文档
    解决NGUI自动被设置LYAER
    ngui的tween的tweenFactor属性
    ngui中 代码调用按钮事件(后来改成了按钮绑定键盘..)
    unity调用摄像头的方法
    坐标转换,这次是反过来,屏幕坐标转换成世界坐标
    unity5.3 安卓广告插件打包出错的理解
    从世界坐标转换成ui的rect坐标的方法
    关于unity碰撞检测器的用法
    测试第一篇标题
  • 原文地址:https://www.cnblogs.com/wang_yb/p/1720787.html
Copyright © 2011-2022 走看看