![](https://oss-emcsprod-public.modb.pro/pdf/bf502f44-7e32-4376-8324-e395f4e0fea8/bg2.jpg)
mkdir /u01/pg11/data
adduser postgres
chown postgres:postgres /u01/pg11/data/
初始化数据库
su - postgres
/u01/pg11/bin/initdb -D /u01/pg11/data
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 "en_US".
The default database encoding has accordingly been set to "LATIN1".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /u01/pg11/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default timezone ... PRC
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:
/u01/pg11/bin/pg_ctl -D /u01/pg11/data -l logfile start
查看日志
cat logfile
2019-07-30 18:18:37.274 CST [12350] LOG: listening on IPv6 address
评论