Index . 블로그창고 . Any comments?

\cat software

PostgreSQL on Cygwin

You may have some problems initializing postmaster as an NT service. Follow the instruction below carefully (If you're using Windows 9x/Me, you may want to read /usr/share/doc/Cygwin/postgresql-*.README, but I didn't try it myself.):

PASSWORD and DBNAME below can be whatever you want.

  1. Login as the administrator.
  2. Go to Start/Settings/Control Panel/System/Advanced/Environment Variables.
    1. Add new System variable:
      • Variable name: CYGWIN
      • Variable value: server
    2. Append c:\cygwin\bin (or your cygwin directory\bin) to Path System variable.
  3. Reboot.
  4. Login as the administrator.
  5. Open the Cygwin shell and run the following:
    chmod 1777 /tmp
    chmod 755 /usr/sbin /usr/sbin/*
    chmod 776 /var/log
    cygserver-config
     # answer yes
    net user postgres PASSWORD /add /fullname:postgres /comment:'PostgreSQL user account' /homedir:"$(cygpath -w /home/postgres)"
    mkpasswd -l -u postgres >> /etc/passwd
    
    # on Windows XP Pro
     cmd /c secpol.msc
    # on Windows XP Home
     editrights -u postgres -a SeServiceLogonRight
    
    cygrunsrv --install postmaster --path /usr/sbin/postmaster --args "-D /var/postgresql/data -i" --dep cygserver --termsig INT --user postgres --shutdown
    mkdir -p /home/postgres
    mkdir -p /var/postgresql/data
    chown postgres /home/postgres /var/postgresql/data
    cygrunsrv -S cygserver
    
  6. Logoff, login as postgres with PASSWORD, and run the following in the Cygwin shell:
    initdb -D /var/postgresql/data
    
  7. Logoff, login as the administrator, and run the following in the Cygwin shell:
    cygrunsrv -S postmaster
    cygrunsrv -Q postmaster
     # check if it's running
    psql -U postgres template1
     # is it working? type \q to quit
    createuser -U postgres
     # add a user. you may want to answer y to both questions
    createdb DBNAME
    psql DBNAME
     # is it working? great!
    

Any comments are welcome.


All the works in this site except software and copyrighted materials by others (e.g., 문학) are licensed under a Creative Commons License. 소프트웨어 및 문학과 같이 다른 이에게 저작권이 있는 작품을 제외하고 모두 크리에이티브 커먼즈 라이센스를 따른다.
Sat Apr 13 13:32:22 2024 . XHTML . CSS (lightbox.css is not part of Uniqki. ;-) . Powered by Uniqki!
refresh . edit . loginout . index