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

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

Share

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

First, create psotgres users

Groupadd postgres

Useradd-g postgres postgres

Second, create a required directory

Download path https://www.enterprisedb.com/download-postgresql-binaries

Wget https://get.enterprisedb.com/postgresql/postgresql-9.6.4-1-linux-x64-binaries.tar.gz

Enter the download directory

Tar-xzf postgresql-9.6.4-1-linux-x64-binaries.tar.gz-C / data/service

Create a data directory:

Mkdir-p / data/service/postgresql/data

Mkdir-p / data/service/postgresql/log

Authorization:

Chown-R postgres.postgres pgsql (extract directory)

Chown-R postgres.postgres postgresql

III. Initialization

Cd / data/service/pgsql/

Su postgres

. / bin/initdb-E utf8-D / data/service/postgresql/data

IV. Start

. / postgres-D / data/service/postgresql/data/ > / data/service/postgresql/log/postgres.log &

Close

. / pg_ctl-D / data/service/postgresql/data stop

Log in

. / psql-U pg-d mydb

--

Remote connection

1 modify pg_hba.conf file

Host all all 127.0.0.1/32 trust

Host all all 192.168.1.0/24 md5

Where the number 24 is the subnet mask, which means that computers of 192.168.1.0 Murray 192.168.1.255 are allowed to access!

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