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 service and start it...
Is this possible (and how) in PostgreSQL?
Thanks in advance
use pgsql bundle zip so u know actual path that not requires installation
initialize database
initdb.exe <datafolderpath>
init.db & pg_ctl is under
pgsql/bin
start database
"pg_ctl" -D "<datafolderpath>" -l logfile start
In addition to what Nirmal wrote, what I usually do:
- Download the ZIP distribution from http://www.enterprisedb.com/products/pgbindownload.do
- Unzip the archive
- Run initdb specifying the location of the desired data directory (note this should not reside in
c:\Program Files
as that is not writeable for a regular user. You should create this e.g. in %APPDATA%
- After initdb has finished, adjust settings in (the generated) postgresql.conf (e.g. shared memory, listen addres, log settings and such). I do this using search & replace.
- The start the server using
pg_ctl
as mentioned by Nirmal (and described in the manual).
- Make sure you start PostgreSQL using the same (Windows) user that you used when running initdb to avoid problems with file permissions!