• postgresql 10 安装


    windows 安装


    第一步: 下载

    https://www.enterprisedb.com/download-postgresql-binaries


    将解压后的文件去掉一层放入 E:Program Files, 程序目录为 E:Program Filespgsql

    第二步: 解压压缩包,配置环境变量

    新建数据目录 E:postgresql11pgsqldata (这是数据库的数据存储文件夹)

    E:Program Filespgsql 新建一个名为env.vbs的文件

    on error resume next
    set sysenv=CreateObject("WScript.Shell").Environment("system") 'system environment array
    Path = CreateObject("Scripting.FileSystemObject").GetFolder(".").Path 'add variable
    sysenv("PGHOME")="C:postgresql11pgsql"
    sysenv("PGHOST")="localhost"
    sysenv("Path")=sysenv("PGHOME")+"in;"+sysenv("Path")
    sysenv("PGLIB")=sysenv("PGHOME")+"lib"
    sysenv("PGDATA")=sysenv("PGHOME")+"data"
     
     wscript.echo "PostgreSQL Success"
    

    双击 env.vbs


    第三步: 初始化数据库

    以管理员身份打开命令提示符,定位到E:Program Filespgsqlin目录下,输入以下命令产生data的数据:

    initdb -D E:postgresql11pgsqldata
    



    • 删除一个服务:
      pg_ctl unregister -N postgresql

    • 增加一个服务:
      pg_ctl register -D E:postgresql11pgsqldata

    • 启动服务
      pg_ctl start -D E:postgresql11pgsqldata

    • 创建用户postgres,密码同样是postgres:
      net user postgres postgres /add

    • 创建PostgreSQL用户和它要找的那个相符
      createuser --superuser postgres

    • 查看系统用户
      net user


    • cli登陆

      psql -U postgres -d postgres


    第四步: pgadmin登陆

    E:Program FilespgsqlpgAdmin 4in下,有pgAdmin4.exe,双击打开


    建立连接




  • 相关阅读:
    Hello_Area_Description 任务三:Project Tango采集区域描述数据
    智能小车 机器人
    Hello_Depth_Perception 任务二:Project Tango采集深度感知数据
    Project Tango Explorer
    make运行阶段划分
    关于chroot
    xargs命令
    debian配置集锦
    gdb使用技巧
    gdb调试使用autotools工程的项目
  • 原文地址:https://www.cnblogs.com/cjwnb/p/13584125.html
Copyright © 2020-2023  润新知