zoukankan      html  css  js  c++  java
  • postgresql13 for window 安装及备份还原数据

    postgresql13 for window 搭建及备份还原数据

    安装

    • 下载 win x86-64
      https://www.enterprisedb.com/download-postgresql-binaries

    • 初始化
      C:installpostgrespgsqlininitdb.exe -D C:installpostgrespgsqldata -E UTF8

    • 启动服务
      C:installpostgrespgsqlinpg_ctl -D C:installpostgrespgsqldata -l logfile.log start

    • 查看进程是否启动
      netstat -aon | findstr 5432

    • 登入
      C:installpostgrespgsqlinpsql.exe postgres

    • 查看所有数据库
      l

    • 修改连接参数及work大小

    • 打开 C:installpostgrespgsqldatapostgresql.auto.conf

    • 添加

         # Do not edit this file manually!
         # It will be overwritten by the ALTER SYSTEM command.
      
         listen_addresses='*'
      
         max_connections=1000
         statement_timeout=1800000
         idle_in_transaction_session_timeout=600000
      
         max_parallel_workers=8
         max_parallel_workers_per_gather=6
      
    • 注意: 修改配置参数后简易重启数据库

    备份

    • 命令
      C:installpostgrespgsqlinpg_dumpall > D:dbackuppg_all_test.sql

    恢复

    • 命令
      C:installpostgrespgsqlinpsql -f D:dbackuppg_all_test.sql postgres

    DB操作命令

    • 停止
      C:installpostgrespgsqlinpg_ctl -D C:installpostgrespgsqldata -l logfile.log stop

    • 启动
      C:installpostgrespgsqlinpg_ctl -D C:installpostgrespgsqldata -l logfile.log start

    • 重载
      C:installpostgrespgsqlinpg_ctl -D C:installpostgrespgsqldata -l logfile.log reload

    funnyzpc@gmail.com
  • 相关阅读:
    215. 数组中的第K个最大元素
    c++集合的操作
    201. 数字范围按位与
    150. 逆波兰表达式求值
    二叉树的遍历算法
    144. 二叉树的前序遍历
    139. 单词拆分 DP
    131. 分割回文串
    695. 岛屿的最大面积 DFS
    leetcode 200. 岛屿数量 DFS
  • 原文地址:https://www.cnblogs.com/funnyzpc/p/14062959.html
Copyright © 2011-2022 走看看