windows系统下postgresql数据库迁移

1、先停掉postgresql服务。任务管理器中找到postgresql服务,选中右键停止。

2、复制C:\zprogram\路径下的pgsql文件夹到E:\zprogram\路径下。

就是把pgsql文件夹从C盘zprogram文件夹挪到E盘zprogram文件夹中。

3、windows+R键,输入regedit,打开注册表,找到\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\postgresql

选中ImagePath,修改

"C:\zprogram\pgsql\bin\pg_ctl.exe" runservice -N "postgresql" -D "C:\zprogram\pgsql\data" -w

前面的C:\zprogram\pgsql\bin\pg_ctl.exe,程序安装地址。

后面的C:\zprogram\pgsql\data,数据库数据存储地址。

修改为

"E:\zprogram\pgsql\bin\pg_ctl.exe" runservice -N "postgresql" -D "E:\zprogram\pgsql\data" -w

4、重启postgresql服务。

  • 7
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值