gb
  English
Phone:  +1 (217) 636-4164
Skype:  onegbits
  1. Home
  2. Blog
  3. How To Install PostgreSQL on Centos 7

How To Install PostgreSQL on Centos 7

How To Install PostgreSQL on Centos 7

16

Sep, 16

628

How To Install PostgreSQL on Centos 7

How To Install PostgreSQL on Centos 7

How To Install PostgreSQL on Centos 7? PostgreSQL, or Postgres, is a relational database management system that provides an implementation of the SQL querying language. It is a popular choice for many small and large projects and has the advantage of being standards-compliant and having many advanced features like reliable transactions and concurrency without read locks. 1. First, add PostgreSQL Yum repository to your system.
rpm -Uvh http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-1.noarch.rpm
2. Install PostgreSQL server.
yum -y install postgresql94 postgresql94-server postgresql94-contrib
Once the postgresql94-server package is installed, you need to initialize a database:
/usr/pgsql-9.4/bin/postgresql94-setup initdb
3. Start PostgreSQL server.
systemctl start postgresql-9.4
systemctl enable postgresql-9.4
4. Configure Iptables or firewall. Adjust iptables to access postgresql from remote systems:
#nano /etc/sysconfig/iptables

firewall-cmd --permanent --add-port=5432/tcp
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --reload
5. Create test database and Create new user PostgreSQL. Once the installation is completed, you can start using the PostgreSQL 9.4 on your CentOS 7 by typing the commands:
su - postgres
psql
Create test database (as postgres user).
createdb 1gbits
Login test database (as postgres user).
psql 1gbits
Delete database (as postgres user).
su - postgres
dropdb <database-name>
Congratulation’s! You have successfully installed PostgreSQL Server. Save Save
Leave A Comment
We are with you

24 X 7 X 365

+1 (217) 636-4164

©2018 1Gbits. All rights reserved