[Windows] PostgreSql installation

Installer installation package problem

Problem running post-install step. Installation may not complete correctly. The database cluster initialisation failed.

The solution can not be online

1, and then reinstall Postgresql election election "Chinese" or "Chinese, Macau SAR" when "Local" instead of the default.

2, ①: enter cmd-net user (Role: View users): Check for the postgres user, but if do not remember your password, then change the password, if not then create a postgres user.

    ②: uninstall the program. If necessary the registry associated with postgresql deleted (I deleted them all), you can enter the "Registry Editor" by typing regedit in the "Run", in the HKEY_CURRENT_USER HKEY_LOCAL_MACHINE related to the software and the postgresql deleted ah. Of course, the best is to be sure and then clean up under the garbage.

3, Data folder to add full control

 

The easiest green installation method: zip archive installation

1, download the compressed package

https://www.enterprisedb.com/download-postgresql-binaries

2, extracting archive data folder add

 

 

3, initialize the database

pgsql\bin>initdb.exe -D "c:\Program Files\PostgreSQL\pgsql\data" -E UTF-8 --locale=chs -U postgres -W

You will be prompted to enter the root password

4. Open the database

pgsql\bin>pg_ctl.exe -D "c:\Program Files\PostgreSQL\pgsql\data" -l logfile start

Wait for the server to complete the process started ....
server process has started

Stop: stop

Restart: restart

5, pgAdmin startup settings

 

Add server

 

 Then add execute permissions users

 

 

6, add the service to system services

pgsql\bin>pg_ctl.exe register -N PostgreSql -D "c:\Program Files\PostgreSQL\pgsql\data"

Close Service

pgsql\bin>pg_ctl.exe -D "c:\Program Files\PostgreSQL\pgsql\data" -l logfile stop

Start by system services

 

 7, modify external access configuration

①, Data / the postgresql.conf                                                                                                                                         
# linkable all                                                                                                                                         
the listen_addresses = '*'                                                                                                                                         
Port = 5432 
#log output in the form of (time, the user, the database, the process, line number)                                                                                                                             
with log_line_prefix = '% D% U% T [p-% L% ] '
②, the Data / the pg_hba.conf                                                                                                                                         
# all users and IP addresses can access the test database                                                                                                                                 
host test all 0.0.0.0/0 trust    

Guess you like

Origin www.cnblogs.com/lixiaobin/p/winsowspostgresql.html