Manual installation of postgresql in Windows

Source: Internet
Author: User

I. Basic installation

1. Download postgresql-8.3.3-2-binaries-no-installer.zip

2. Decompress sql-8.3.3-2-binaries-no-installer.zip to c :\

3. Detailed installation steps are as follows:

 

 

 

(Execute commands with Super User Permissions)

C: \> Cd pgsql

C: \ pgsql> dir
The volume in drive C is WINXP
The serial number of the volume is 382e-2b62.

C: \ pgsql directory

<Dir>.
<Dir> ..
<Dir> Bin
<Dir> Doc
<Dir> include
<Dir> lib
<Dir> share
<Dir> symbols
0 files, 0 bytes
1,241,993,216 bytes available for 8 Directories

C: \ pgsql> net user Postgres password/Add/expires: Never/passwordchg: No
The command is successfully completed.

C: \ pgsql> net localgroup users Postgres/del
The command is successfully completed.

C: \ pgsql> cacls./t/e/P Postgres: R

Processed file: C: \ pgsql \ symbols \ vacuumdb. PDB
Processed file: C: \ pgsql \ symbols \ vacuumlo. PDB
Processed file: C: \ pgsql \ symbols \ zic. PDB
Processed file: C: \ pgsql \ symbols \ _ Int. PDB

C: \ pgsql> RunAs/noprofile/ENV/User: S "cmd"
Enter Postgres password: Password
Try to start cmd as user "FMX-7E918992334 \ Postgres...

C: \ pgsql>

 

 

(Execute commands with Postgres user permissions)

Microsoft Windows XP [version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C: \ pgsql> bin \ initdb.exe-D data-e euc_cn -- locale = C-a MD5-u admin-W
The file host of this database system is "s ".
This user must also be the host of the server process.
The database cluster will be initialized with locale C.
The default text search configuration will be set to "English ".

Directory data... created
Creating subdirectories... successful
Select the default maximum number of connections (max_connections)... 100
Selecting default shared_buffers/max_fsm_pages... 32 MB/204800
Configuration File Created...
The template1 database is created in data/base/1...
Initializing pg_authid... successful
Enter the new Superuser password: adminpassword
Enter adminpassword again.
Password set...
Initializing dependencies... successful
System View created...
Loading System Objects 'descriptions... successful
Character Set conversion... created
Creating dictionaries... successful
Permission set for internal object... successful
Information Mode created...
The database template1 is cleared...
Template1 is copied to template0...
Copying template1 to copying s... successful

Success. You can now start the database server using:

"Bin \ Postgres"-d "data"
Or
"Bin \ pg_ctl"-d "data"-l logfile start

C: \ pgsql> bin \ pg_ctl.exe-D data-l logfile start
Server starting

C: \ pgsql> bin \ pg_ctl.exe-D data stop
Waiting for server to shut down... Done
Server stopped

C: \ pgsql>

 

 

 

 

Ii. Annotations:

1. Net localgroup users Postgres/del

Delete the Postgres user from the Users Group, so that Postgres cannot be logged on, making it safer.

 

2. When using pgadmin III to connect to the database, use the admin user and the password is adminpassword.

 

Iii. Automatic startup as a Windows Service

(Execute commands with Super User Permissions)

Registration Service:

C: \ pgsql> bin \ pg_ctl register-N postgresql-d c: \ pgsql \ data

Logout service:

C: \ pgsql> bin \ pg_ctl unregister-N PostgreSQL

Start the service:

C: \ pgsql> SC start PostgreSQL

Stop Service:

C: \ pgsql> SC stop PostgreSQL

 

 

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.