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

Offline installation of PostgreSQL

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

Share

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

It is easy to install postgresql online, but in many cases, the server cannot be connected to the Internet and needs to be installed offline. Here are the steps for offline installation:

1. First, go to the official website:

Https://www.postgresql.org/

two。 Click Download

3. Select the desired operating system version

4. Select the version you want

5. Download the yum source on a computer that is connected to the Internet

Yum install https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-6-x86_64/pgdg-centos95-9.5-3.noarch.rpm

6. Download postgres software

Yum search postgres

Mkdir psql95

Yum install-downloadonly-downloaddir=psql95 postgresql95 postgresql95-server

7. View downloaded software packages

# ls

Postgresql95-9.5.13-1PGDG.rhel6.x86_64.rpm

Postgresql95-libs-9.5.13-1PGDG.rhel6.x86_64.rpm

Postgresql95-server-9.5.13-1PGDG.rhel6.x86_64.rpm

8. Package and transfer to the offline server that needs to be installed

# tar-zcvf pg.tar.gz *

Postgresql95-9.5.13-1PGDG.rhel6.x86_64.rpm

Postgresql95-libs-9.5.13-1PGDG.rhel6.x86_64.rpm

Postgresql95-server-9.5.13-1PGDG.rhel6.x86_64.rpm

9. Unpack and install at the installation end

Rpm-ivh postgresql95-*

10. Start

# service postgresql-9.5 initdb

# service postgresql-9.5 start

# chkconfig postgresql-9.5 on

11. Connect postgres

Su-postgres

Psql

Postgres=#\ l List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges-+- -postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | = c/postgres + | postgres=CTc/postgres template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | = c/postgres + | postgres=CTc/postgres (3 rows)

At this point, the offline installation is complete.

12. For Postgresql 10, it should be noted that the database installed cannot be accessed remotely, and some permissions should be set:

Find the file postgresql.conf

Find /-name "postgresql.conf"

Modify

The listen_addresses key value is set to "*"

Find the file pg_hba.conf

Find /-name "pg_hba.conf"

Add the following

Host all all 0.0.0.0/0 md5

13. Create the appropriate database and users, and you can access them remotely.

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