簡體   English   中英

如何在windows上手動配置啟動PostgreSQL?

[英]How to manually configure and start PostgreSQL on windows?

I have application that use mysql database, but now i need to port it to postgres... In my current installation i have embedded mySQL binaries, and i manually change my.ini file to change default location of mysql server to apppath, install mySQL服務並啟動它...在 PostgreSQL 中是否可能(以及如何)?

提前致謝

使用 pgsql 包 zip 所以你知道不需要安裝的實際路徑

初始化數據庫

initdb.exe <datafolderpath>

init.db & pg_ctl 在

pgsql/bin

啟動數據庫

"pg_ctl" -D "<datafolderpath>" -l logfile start

除了 Nirmal 寫的,我通常會做的事情:

  • http://www.enterprisedb.com/products/pgbindownload.do下載 ZIP 發行版
  • 解壓存檔
  • 運行 initdb 指定所需數據目錄的位置(注意,這不應駐留在c:\Program Files中,因為它對於普通用戶是不可寫的。您應該在例如 %APPDATA% 中創建它
  • initdb 完成后,調整(生成的)postgresql.conf 中的設置(例如共享 memory、監聽地址、日志設置等)。 我使用搜索和替換來做到這一點。
  • 使用 Nirmal 提到的pg_ctl啟動服務器(並在手冊中描述)。
  • 確保使用運行 initdb 時使用的相同 (Windows) 用戶啟動 PostgreSQL 以避免文件權限問題!
  • 您可以使用pg_ctl register...創建一個 Windows 服務來自動啟動 Postgres。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM