Os:windows 10
db:v10.4
1. Set system variable
%postgresql_root% = E:\progFiles\pgsql-10.4
2. Init database
Initdb-d%postgresql_root%\data-u xiaobin-w-e utf8-a password
-u: Super user.
General use of the local administrator account, the machine is: Xiaobin
-W: The password for the super user.
" Xiaobin " "Chinese (Simplified) _china.936" is initialized. INITDB: Unable to localize locale " Chinese (Simplified) _china.936 " find the appropriate text search configuration The default text search configuration will be set to " Simple " suppresses the generation of checksums for data pages. Enter a new Superuser password: Enter again:
-E: Character Set
-A: Authentication method
Password: password mode
Execution Result:
Create directory e:/progfiles/pgsql-10.4/ + Select default shared buffer size (shared_buffers) ... 128MB Select dynamic shared memory Implementation ... Windows Create configuration file ... Successfully running bootstrap script ... Success is executing bootstrap after initialization ... Successfully synchronizing data to disk ... Successful success. You can now start the database server using: -D ^"e^:^\progfiles^\pgsql^-10^.4^\data^" /c7>-L logfile Start
3. Start Database
pg_ctl-d%postgresql_root%\data-l%postgresql_root%\logs\logfile0726 Start
4. Manage DB
(1) Establish file
Create a 0-byte file (pgadmin 4\venv\lib\site-packages\backports\__init__.py)
(2) Open PgAdmin4
Double-click "PgAdmin4.exe"
Reference:
1. Initdb
2. "Starting PostgreSQL and Pgadmin in Windows without installation"
PostgreSQL (Zip) installed on Windows