initdb

一个服务器实用程序,用于创建一个新的 PostgreSQL 集群

initdb 是一个 服务器实用程序,用于初始化一个新的 PostgreSQL 集群的数据目录。

initdb 始终存在于 PostgreSQL 中。

变更历史

示例

initdb 的基本用法示例

$ initdb -D /var/lib/pgsql
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "C".
The default database encoding has accordingly been set to "SQL_ASCII".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/pgsql ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default timezone ... UTC
selecting dynamic shared memory implementation ... posix
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:

    pg_ctl -D /var/lib/pgsql -l logfile start
  • PostgreSQL 文档: initdb

分类

配置, 数据目录, 服务器实用程序, 存储

另请参阅

pg_ctl

反馈

请在此处提交任何关于“initdb”的评论、建议或更正 这里