Re: Need some help getting started - Mailing list pgsql-cygwin
From | Dan |
---|---|
Subject | Re: Need some help getting started |
Date | |
Msg-id | 20031029175347.12644.qmail@web10708.mail.yahoo.com Whole thread Raw |
In response to | Re: Need some help getting started (Jason Tishler <jason@tishler.net>) |
List | pgsql-cygwin |
PostgreSQL-Cygwin Installation Steps On Windows 9x/Me, you can only install postgresql as an app: 1. Start the cygipc ipc-daemon2: $ ipc-daemon2 & 2. Initialize PostgreSQL: $ initdb -D /usr/share/postgresql/data 3. Start the PostgreSQL postmaster: $ postmaster -D /usr/share/postgresql/data & 4. Connect to PostgreSQL: $ psql template1 For Windows XP Home, Windows XP Pro, Windows NT 4.0, Windows 2000, it's better to install it as a service: In the following steps, replace the following placeholders with appropriate values: [USER_1] : Any Windows Admin user. Example: joeuser. [POSTGRES_USER_DIR]: directory to the postgres user's home directory. Example: /home/postgres [POSTGRES_PASSWORD]: password for postgres user account. Must be non-blank. Example: anonblankpwd 1. Make sure Cygwin's bin directory (e.g., C:\Cygwin\bin) is added to the Windows NT/2000's system PATH and the machine rebooted for the SCM to find cygwin1.dll. 2. Log in as [USER_1] 3. Install the cygipc ipc-daemon2 as a NT service: $ ipc-daemon2 --install-as-service 4. Create the "postgres" user account: $ net user postgres [POSTGRES_PASSWORD] /add /fullname:postgres /comment:'PostgreSQL user account' /homedir:"[POSTGRES_DIR]" $ mkpasswd -l -u postgres >>/etc/passwd 5. Grant the "postgres" user the "Log on as a service" user right. (See http://support.microsoft.com/default.aspx?scid=KB;en-us;q259733 for a Microsoft KB article explaining how to configure user rights.): # If on Windows XP Home: # I think you have to download and install the ntrights utility for setting nt permissions # from here http://www.dynawell.com/reskit/microsoft/win2000/ntrights.zip $ editrights -u postgres -a SeServiceLogonRight # else if on Windows NT 4.0: # start User Manager, select Policies, and then select User Rights... # else if on Windows 2000 or XP Pro: $ cmd /c secpol.msc 6. Install postmaster as a NT service (Clean postmaster shutdown will only work with a post Cygwin 1.3.2 snapshot from 2001-Jul-28 or later.): $ cygrunsrv --install postmaster --path /usr/bin/postmaster --args "-D /usr/share/postgresql/data -i" --dep ipc-daemon2 --termsig INT --user postgres --shutdown 7. Create the PostgreSQL data directory: $ mkdir /usr/share/postgresql/data 8. Change ownership of the PostgreSQL data directory (Assumes that ntsec is set via the CYGWIN environment variable): $ chown postgres /usr/share/postgresql/data 9. Start the cygipc ipc-daemon2 If ipc-daemon2 is not running or a version previous to 2.01-1 is running, then initdb and postmaster can fail with the error message: IpcSemaphoreCreate: semget(...) failed: Function not implemented and IpcMemoryCreate: shmget(...) failed: Function not implemented respectively. $ cygrunsrv -S ipc-daemon2 10. Switch from [USER_1] to "postgres": 11. Initialize PostgreSQL: $ initdb -D /usr/share/postgresql/data 12. Switch from "postgres" to [USER_1]: 13. Start postmaster: $ cygrunsrv -S postmaster 14. Verify postmaster is running (If postmaster fails to start, then examine /var/log/postmaster.log and/or the NT Event Log): $ cygrunsrv -Q postmaster 15. Connect to PostgreSQL (This can be run as any user. One can use PostgreSQL's createuser command or set PGUSER to obviate the need to specify "-U postgres" on the psql command line): $ psql -U postgres template1 __________________________________ Do you Yahoo!? Exclusive Video Premiere - Britney Spears http://launch.yahoo.com/promos/britneyspears/
pgsql-cygwin by date: