PG

PostgreSQL Windows 安装

  • 准备好安装包postgresql-11.5-1-windows-x64-binaries.zip
  • 默认情况下,会将当前的 Windows 用户作为管理员,例如“Chris”
  • 注意在初始化连接之后,在防火墙中开放5432端口。

安装

解压到E盘根目录中

E:>bininitdb.exe -D data -E UTF8
The files belonging to this database system will be owned by user "Chris".
This user must also own the server process.

The database cluster will be initialized with locale "English_United States.1252".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default timezone ... Asia/Hong_Kong
selecting dynamic shared memory implementation ... windows
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

binpg_ctl -D data -l logfile.txt start

E:>binpsql postgres

原文地址:https://www.cnblogs.com/duchaoqun/p/12874336.html