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

CentOS 7.5 1804 yum install Postgre

2024-09-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

1. Preparatory work:

1.postgresql official website: https://www.postgresql.org

two。 Download page: https://www.postgresql.org/download/

3.Red Hat Family Linux (including CentOS/Fedora/Scientific/Oracle) download page: https://www.postgresql.org/download/linux/redhat/

4. The system used in this paper is: centos 7.51804

5. You can use the following URL to find the corresponding postgresql yum installation page:

Https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-centos11-11-2.noarch.rpm

Second, the system executes the command:

1.yum install-y https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-centos11-11-2.noarch.rpm

Yum-y install postgresql11yum-y install postgresql11-server/usr/pgsql-11/bin/postgresql-11-setup initdbsystemctl enable postgresql-11systemctl start postgresql-11

3. Open the PostgreSQL port (this step can be ignored if the firewall is off) firewall-cmd-- zone=public-- add-port=5432/tcp-- permanentfirewall-cmd-- reloadfirewall-cmd-- list-ports

4. Set the password for postgres

Last login: Fri Jul 19 17:13:49 CST 2019 on pts/0

-bash-4.2$ psql-U postgres

Psql 11.4

Type "help" for help.

Postgres=# ALTER USER postgres with encrypted password 'welcome1'

ALTER ROLE

Postgres=#\ Q

-bash-4.2$ exit

Logout

Fifth, set up remote access

Command:

Vim / var/lib/pgsql/11/data/postgresql.conf

After opening it, you can find: listen_addresses is modified to:

Listen_addresses =''

The IP address to listen on; a comma-separated list of addresses; the default is' localhost'; for all'. Save and close after modification.

Command:

Vim / var/lib/pgsql/11/data/pg_hba.conf

After opening the text, the new content is as follows:

Host all all 0.0.0.0/0 md5

Save and close editing after the modification is complete.

six. Restart the postgres database

Systemctl restart postgresql-11

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