• 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方面的应用。
    希望能和大家多交流交流,同时能得到高手的指教!
  • 相关阅读:
    REPL
    java实现指数问题
    java实现指数问题
    java实现串逐位和(C++)
    java实现串逐位和(C++)
    java实现串逐位和(C++)
    java实现串逐位和(C++)
    java实现串逐位和(C++)
    手工日期计算法
    手工日期计算法
  • 原文地址:https://www.cnblogs.com/wang_yb/p/1720787.html
Copyright © 2020-2023  润新知