Postgresql 9.4.0-1 x64 Win7 decompression version installation steps

Source: Internet
Author: User
Tags postgresql

First, download unzip

1, download postgresql-9.4.0-1-windows-x64-binaries.zip

2, unzip postgresql-9.4.0-1-windows-x64-binaries.zip to E:\

Second, add users

1. Add Windows user to start PostgreSQL windows service
NET user Postgres Pgsqlpw/add/expires:never/passwordchg:no

2, to ensure security, this user is not allowed to log on locally
net localgroup users Postgres/del

3, assign windows user postgres access to the PostgreSQL installation directory
cacls. /T/E/P Postgres:r

4. Configure Environment Variables :

Third, initialize the database

1. Configure environment Variables :

Pg_home = E:\postgresql-9.4.0-1-windows-x64

PGDATA =%pg_home%\data

PGHOST = localhost

Pglib =%pg_home%\lib

Path =%path%; %pg_home%\bin;

2. switch to the Windows user postgres Command-line environment
Runas/noprofile/env/user:postgres cmd

Note: With the Administrator account, the postgres account initialization, change the password on it.

3, Initialize the database , If you do not use- u admin, The database automatically add the current Windows user ( that is , postgres) is the database account number
initdb.exe-d E:\postgresql-9.4.0-1-windows-x64\data-E UTF-8--locale=chs

4. Start the database
Pg_ctl.exe-d E:\postgresql-9.4.0-1-windows-x64\data-l logfile Start

5, Stop the database
Pg_ctl.exe-d E:\postgresql-9.4.0-1-windows-x64\data Stop

Iv. registering as a Windows service

1, registered as a Windows service , the current windows user ( IE postgres) will act as a login user for the PostgreSQL Service
Pg_ctl.exe register-d E:\postgresql-9.4.0-1-windows-x64\data-NPostgreSQL

2. start the PostgreSQL service
net start PostgreSQL

Five , Connection Test

Psql-upostgres-w

Postgresql 9.4.0-1 x64 Win7 decompression version installation steps

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.