Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

PostgreSQL 9.6.1 Source installation

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

RHEL7.2+PostgreSQL9.6.1

Requirements softwares

1.GNU make version 3.80 or newer is required

[root@rhel7] # make-- version

GNU Make 3.82

Built for x86_64-redhat-linux-gnu

2.You need an ISO/ANSI C compiler (at least C89-compliant). Recent versions of GCC are recommended

[root@rhel7] # gcc-- version

Gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)

3. Tar is required to unpack the source distribution, in addition to either gzip or bzip2.

4.The GNU Readline library is used by default.

Readline

Readline-devel

Libedit

Optional

Perl 5.8 or later

Python

Kerberos

OpenSSL

OpenLDAP

And/or PAM

Flex 2.5.31 or later

Bison 1.875 or later

Useradd pguser

Su-pguser

Tar-zxvf postgresql-9.6.1.tar.gz

Install

Cd postgresql-9.6.1

. / configure

Default installation directory / usr/local/pgsql, which can be modified using-- prefix=path,. / configure-- help

Make

The last line displayed should be:

All of PostgreSQL successfully made. Ready to install.

Su (installed using root)

Make install

PostgreSQL installation complete.

Set the environment variables for pguser

Mkdir / usr/local/pgsql/data # PostgreSQL data storage directory

Chown pguser:pguser / usr/local/pgsql/data

Export LD_LIBRARY_PATH=/usr/local/pgsql/lib

Export PG_HOME=/usr/local/pgsql

Export PATH=$PG_HOME/bin/:$PATH

Export PGDATA=/usr/local/pgsql/data

Initilize the DBServer

(using pguser)

[pguser@rhel7 ~] $initdb-D / usr/local/pgsql/dataThe files belonging to this database system will be owned by user "pguser" .This user must also own the server process.The database cluster will be initialized with locale "en_US.UTF-8" default database encoding has accordingly been set to "UTF8" default text search configuration will be set to "english" .data page checksums are disabled.fixing permissions on existing directory / usr/local/pgsql/data. Okcreating subdirectories... Okselecting default max_connections... 100selecting default shared_buffers... 128MBselecting dynamic shared memory implementation... Posixcreating configuration files... Okrunning bootstrap script... Okperforming post-bootstrap initialization... Oksyncing data to disk... OkWARNING: enabling "trust" authentication for local connectionsYou 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 / usr/local/pgsql/data-l logfile start

Start the DBServer

[pguser@rhel7] $postgres-D / usr/local/pgsql/data > logfile 2 > & 1 & [1] 13799 [pguser@rhel7 ~] $ps-ef | grep postgrepguser 13799 4377 0 12:37 pts/0 00:00:00 postgres-D / usr/local/pgsql/datapguser 13801 13799 0 12:37? 00:00:00 postgres: checkpointer process pguser 13802 13799 0 12:37? 00:00:00 postgres: writer process pguser 13803 13799 0 12:37? 00:00:00 postgres: wal writer process pguser 13804 13799 12:37? 00:00:00 postgres: autovacuum launcher process pguser 13805 13799 0 12:37? 00:00:00 postgres: stats collector process pguser 13807 4377 0 12:37 pts/0 00:00:00 grep-- color=auto postgre

Connection test

[pguser@rhel7 ~] $psql-- list List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges-+- -postgres | pguser | UTF8 | en_US.UTF-8 | en_US.UTF-8 | template0 | pguser | UTF8 | en_US.UTF-8 | en_US.UTF-8 | = c/pguser + | pguser=CTc/pguser template1 | pguser | UTF8 | en_US.UTF-8 | en_US.UTF-8 | = c/pguser + | pguser=CTc/pguser (3 rows) [pguser@rhel7 ~] $psql postgrespsql (9.6.1) Type "help" for help.postgres=# select version () Version -- PostgreSQL 9.6.1 on x86_64-pc-linux-gnu Compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4), 64-bit (1 row) postgres=# select current_date Date-2016-12-01 (1 row) postgres=#\ Q

Official document: https://www.postgresql.org/docs/9.6/static/installation.html

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report