PostgreSQL 8.2.5 is installed as a Windows Service)

Source: Internet
Author: User
Sometimes, when installing PostgreSQL windows, it will fail to create a Windows service. After you cancel the "Install as service" option, how can you manually install it as a service?

1. first, check the user, that is, the user who starts the postgresql service. The default user is ipvs, choose "Control Panel"> "Computer Management"> "local users and groups" to check whether there are ipvs users. If yes, delete the user first.

2. Add the Postgres user through the command line, as shown below:C :\>Net user ipvs pass/Add/Expires: Never/passwordchg: No

The above command creates an ipvs user. The password is pass. The user account does not expire and the user cannot change the password.

After the user is created, the user is deleted from the Users Group as follows:C :\>Net localgroup users ipvs/Delete

3. create a postgresql service with the following command: (assume that our database is created under E: \ pgsql \ data and use the createdb command to create a database) D: \ Program Files \ PostgreSQL \ 8.2 \ bin > pg_ctl register - N postgresql - U Postgres - P pass - d e: \ pgsql \ data

4. Specify the access permissions of the ipvs user as follows:D: \ Program Files \ PostgreSQL \8.2>Cacls./T/E/P Postgres: R

The above command sets the directory readable for the D: \ Program Files \ PostgreSQL \ 8.2 directory by the Postgres user.

E: \ pgsql > Cacls. / T / E / P Postgres: R
E: \ pgsql > Cacls data / T / E / P Postgres: c

The preceding command sets the writable directory for E: \ pgsql \ data)

5. Start PostgreSQL in the service.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.