结果没提示异常【error】便表示安装成功
/bin/install -c -m 644 Makefile.global '/usr/local/pgsql-10.5/lib/pgxs/src/Makefile.global'
/bin/install -c -m 644 Makefile.port '/usr/local/pgsql-10.5/lib/pgxs/src/Makefile.port'
/bin/install -c -m 644 ./Makefile.shlib '/usr/local/pgsql-10.5/lib/pgxs/src/Makefile.shlib'
/bin/install -c -m 644 ./nls-global.mk '/usr/local/pgsql-10.5/lib/pgxs/src/nls-global.mk'
make[1]: Leaving directory `/package/postgresql-10.5/src'
make -C config install
make[1]: Entering directory `/package/postgresql-10.5/config'
/bin/mkdir -p '/usr/local/pgsql-10.5/lib/pgxs/config'
/bin/install -c -m 755 ./install-sh '/usr/local/pgsql-10.5/lib/pgxs/config/install-sh'
/bin/install -c -m 755 ./missing '/usr/local/pgsql-10.5/lib/pgxs/config/missing'
make[1]: Leaving directory `/package/postgresql-10.5/config'
PostgreSQL installation complete.
9、安装完成后可以看到在/usr/local目录上成了pgsql-10.5目录
[root@web1 postgresql-10.5]# ll /usr/local/ |grep pgsql-10.5
drwxr-xr-x 6 root root 56 May 23 18:06 pgsql-10.5
[root@web1 postgresql-10.5]#
10、创建用户及设置/usr/local/pgsql-10.5目录文件属主组
[root@web1 postgresql-10.5]# useradd postgres
[root@web1 postgresql-10.5]# chown -R postgres.postgres /usr/local/pgsql-10.5/
[root@web1 postgresql-10.5]# ll /usr/local/ |grep pgsql-10.5
drwxr-xr-x 6 postgres postgres 56 May 23 18:06 pgsql-10.5
[root@web1 postgresql-10.5]#
11、给/usr/local/pgsql-10.5目录设置软连接(方便查看和管理吧....)
[root@web1 postgresql-10.5]# ln -s /usr/local/pgsql-10.5/ /usr/local/pgsql
[root@web1 postgresql-10.5]# ll /usr/local/pgsql
lrwxrwxrwx 1 root root 22 May 23 18:15 /usr/local/pgsql -> /usr/local/pgsql-10.5/
[root@web1 postgresql-10.5]#
12、进入刚创建的postgres用户
[root@web1 postgresql-10.5]# su postgres
[postgres@web1 postgresql-10.5]$
13、设置环境变量(注意路径)
[postgres@web1 ~]$ vim ~/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH=$PATH:/usr/local/pgsql-10.5/bin
PGDATA=/usr/local/pgsql-10.5/data
export PGDATA
export PATH
14、当前生效
[postgres@web1 ~]$ source ~/.bash_profile
[postgres@web1 ~]$
15、测试
[postgres@web1 ~]$ which psql
/usr/local/pgsql-10.5/bin/psql
[postgres@web1 ~]$ psql -V
psql (PostgreSQL) 10.5
16、初始化数据库(initdb --help查看讲情),指定库文件路径
[postgres@web1 ~]$ initdb /usr/local/pgsql-10.5/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.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.
creating directory /usr/local/pgsql-10.5/data ... 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 yo