Linux system dependent packages: [Email protected] ~]# gcc--version GCC (gcc) 4.4.7 20120313 (Red Hat 4.4.7-4) Copyright (C) Free Software Foundation, Inc. This was free software; See the source for copying conditions. There is NO Warranty Not even to merchantability or FITNESS for A particular PURPOSE. [email protected] ~]# make --version GNU make 3.81 Copyright (C) 2006 free Software Foundation, Inc. This was free software; See the source for copying conditions. There is NO warranty; Not even to merchantability or FITNESS for A Particular PURPOSE. This program built for X86_64-REDHAT-LINUX-GNU [Email protected] ~]# Rpm-qa|grep ReadLine Compat-readline5-5.2-17.1.el6.x86_64 readline-devel-6.0-4.el6.x86_64 Readline-6.0-4.el6.x86_64 [Email protected] ~]# Rpm-qa|grep zlib Zlib-1.2.3-29.el6.x86_64 zlib-devel-1.2.3-29.el6.x86_64 Installing PostgreSQL 5.2 [Email protected] mnt]# TAR-JXVF postgresql-9.5.2.tar.bz2 [Email protected] mnt]# CD postgresql-9.5.2 [Email protected] postgresql-9.5.2]#/configure--prefix=/pg952/ [email protected] postgresql-9.5.2]# make world [email protected] postgresql-9.5.2]# make Install-world [Email protected] pg952]# cd/pg952/ [email protected] pg952]# LL Total 32 Drwxr-xr-x 2 root root 4096 05-26 05:41 bin Drwxr-xr-x 4 root root 4096 05-26 05:40 include Drwxr-xr-x 4 root root 4096 05-26 05:40 Lib Drwxr-xr-x 5 root root 4096 05-26 05:40 share [[email protected] pg952]# ID postgres Uid=26 (Postgres) gid=26 (postgres) groups=26 (postgres) Context=root:system_r:unconfined_t:systemlow-systemhigh [Email protected] pg952]# chown-r postgres:postgres/pg952/ [Email protected] pg952]# ll/pg952/ Total 32 Drwxr-xr-x 2 postgres postgres 4096 05-26 05:41 bin Drwxr-xr-x 4 postgres postgres 4096 05-26 05:40 include Drwxr-xr-x 4 postgres postgres 4096 05-26 05:40 Lib Drwxr-xr-x 5 postgres postgres 4096 05-26 05:40 share [Email protected] pg952]# Su-postgres -bash-3.2$ vim. Bash_profile--Add the following environment variables [-f/etc/profile] && Source/etc/profile Export pghome=/pg952 Export Pgdata=/pg952/data Export ld_library_path= $PGHOME/lib: $LD _library_path
Path= $PGHOME/bin: $PATH
-bash-3.2$ pg_ctl Init --Initialize database -bash-3.2$ Vim postgresql.conf--Modify the configuration file #listen_addresses = ' localhost ' # What IP address (es) to listen on; listen_addresses = ' * ' -bash-3.2$ Vim pg_hba.conf--Modify the configuration file # IPV4 Local connections: Host All 127.0.0.1/32 Trust Host all 192.168.72.0/24 MD5 -bash-3.2$ pg_ctl start-l $PGHOME/logfile 2>&1 >/dev/null --Start the database Note: Pg_ctl Start|status|stop|restart for database startup -bash-3.2$ Ps-ef|grep Post--View database status -bash-3.2$ Cat LogFile -bash-3.2$ ps-f-U postgres To connect to a database: -bash-3.2$ Psql--Local connection Psql (9.5.2) Type ' help ' for help. postgres=# \l .......... postgres-# \password--Modify PG Password Enter New Password: Enter It again: C:\users\wangwc>psql-h 192.168.72.130-u postgres-d Oracle-Remote Connection |