加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

PostgreSQL学习第三篇--安装后的配置

发布时间:2020-12-13 17:01:00 所属栏目:百科 来源:网络整理
导读:为了以后方便,对pg安装路径建立软连接:[root@single bin]# ln -sf /usr/pg/postgresql-9.6.1/ /usr/local/pgsql配置postgres用户的.bash_profilePATH=/usr/local/pgsql/bin:$PATH:$HOME/binexport PATHexport LD_LIBRARY_PATH=/usr/local/pgsql/lib创建数
为了以后方便,对pg安装路径建立软连接:
[root@single bin]# ln -sf /usr/pg/postgresql-9.6.1/ /usr/local/pgsql

配置postgres用户的.bash_profile


PATH=/usr/local/pgsql/bin:$PATH:$HOME/bin

export PATH

export LD_LIBRARY_PATH=/usr/local/pgsql/lib


创建数据库簇:
[postgres@single ~]$ initdb
initdb: no data directory specified
You must identify the directory where the data for this database system
will reside.  Do this with either the invocation option -D or the
environment variable PGDATA.

在.bash_profile中配置数据目录:

export PGDATA=/home/postgres/pgdata

[postgres@single ~]$ initdb
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.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /home/postgres/pgdata ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
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 /home/postgres/pgdata -l logfile start

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读