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 binary Quick installation

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Binary installation steps:

Groupadd postgres

Useradd-g postgres postgres

Id postgres

Passwd postgres

Mkdir-p / data/postgresql/data

Mkdir-p / data/postgresql/log

Tar xf postgresql-9.5.9-1-linux-x64-binaries.tar.gz-C / usr/local/

Cd / usr/local/

Chown-R postgres.postgres pgsql

Cd / data

Chown-R postgres.postgres postgresql

Cd / usr/local/pgsql/bin/

Vim / etc/profile

Source / etc/profile

Ordinary users start postgreSQL service

Su-postgres

Initialize the database:

Initdb-E utf8-D / data/postgresql/data

Start the database:

Pg_ctl-D / data/postgresql/data-l/data / postgresql/log/postgres.log start

[root@localhost log] # tailf / data/postgresql/log/postgres.log

LOG: could not create IPv6 socket: Address family not supported by protocol

LOG: database system was shut down at 2017-10-04 18:06:18 CST

LOG: MultiXact member wraparound protections are now enabled

LOG: database system is ready to accept connections

LOG: autovacuum launcher started

Turn off the postgresql service

Pg_ctl-D / data/postgresql/data-l/data / postgresql/log/postgres.log stop

[root@localhost log] # tailf / data/postgresql/log/postgres.log

LOG: received fast shutdown request

LOG: aborting any active transactions

LOG: autovacuum launcher shutting down

LOG: shutting down

LOG: database system is shut down

Restart the postgresql service

Pg_ctl-D / data/postgresql/data-l/data / postgresql/log/postgres.log restart

[root@localhost log] # tailf / data/postgresql/log/postgres.log

LOG: received fast shutdown request

LOG: aborting any active transactions

LOG: autovacuum launcher shutting down

LOG: autovacuum launcher shutting down

LOG: shutting down

LOG: database system is shut down

LOG: could not create IPv6 socket: Address family not supported by protocol

LOG: database system was shut down at 2017-10-04 18:08:15 CST

LOG: MultiXact member wraparound protections are now enabled

LOG: database system is ready to accept connections

LOG: autovacuum launcher started

View the startup log:

Tail-100f / data/postgresql/log/postgres.log

Ps-ef

Login to the database:

Psql

You don't need a password to log in to postgresql database by default.

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

Database

Wechat

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

12
Report