A number of dependencIEs are on the EPEL repository. Run the following command to install epel repository in your CentOS 7 machine.
sudo yum -y install epel-releaseStep 3: Install PostGIS on CentOS 7
After the installation of Postgresql and adding EPEL repository,proceed to install PostGIS from the Postgresql added. The repository was added using command like below.
sudo yum install https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-centos11-11-2.noarch.rpm
Then install PostGIS on CentOS 7 by running the command below.
sudo yum install postgis25_11
This will install PostGIS v2.5 for Postgresql 11. The version installed can be checked with:
$ rpm -qi postgis25_11Step 4: Enable PostGIS Spatial features
name : postgis25_11
Version : 2.5.1
Release : 4.rhel7
Architecture: x86_64
Install Date: Wed 20 Feb 2019 10:37:35 PM CET
Group : Applications/Databases
Size : 32649231
license : GPLv2+
Signature : DSA/SHA1,Wed 02 Jan 2019 12:45:12 PM CET,Key ID 1f16d2e1442df0f8
Source RPM : postgis25_11-2.5.1-4.rhel7.src.rpm
Build Date : Wed 02 Jan 2019 12:44:54 PM CET
Build Host : koji-centos7-x86-64-pgbuild
Relocations : (not relocatable)
vendor : Postgresql Global Development Group
URL : http://www.postgis.net/
Summary : Geographic information Systems Extensions to Postgresql
Description :
PostGIS adds support for geographic objects to the Postgresql object-relational
database. In effect,PostGIS "spatially enables" the Postgresql server,
allowing it to be used as a backend spatial database for geographic information
systems (GIS),much like ESRI‘s SDE or Oracle‘s Spatial extension. PostGIS
follows the OpenGIS "Simple Features Specification for sql" and has been
certifIEd as compliant with the "Types and Functions" profile.
You need to activate PostGIS features on a database before you can store spacial data. The example below will show you how to create a database and activate the Spacial features.
1.
Switch to postgres user.
sudo -i -u postgres
2.
Create test user/database.
-bash-4.2$ createuser test_user
-bash-4.2$ createdb test_db -O test_user
3.
Connect to the test database:
n this article,we are going to show you how to install Postgresql 11 (Postgres) database on CentOS 7 or RHEL 7.
Step 1: Add Postgresql YUM Repository– Add Postgresql yum repository
# rpm -Uvh https://yum.postgresql.org/11/redhat/rhel-7-x86_64/pgdg-centos11-11-2.noarch.rpmStep 2: Install Postgresql
# sudo yum install postgresql11-server
– Now that the database packages have been installed,Initialize the database by running the following command:
# sudo /usr/pgsql-11/bin/postgresql-11-setup initdbInitializing database ... OK
– Use the below commands to start,enable the Postgresql 11 and check its status
# sudo systemctl start postgresql-11.service# sudo systemctl enable postgresql-11.service# sudo systemctl status postgresql-11.serviceStep 3: Connect to Postgresql
– After installing Postgresql 11 database server,by default Postgresql,will create a system account user named postgreswith role postgres.
– To connect to the Postgresql database server,use the following commands:
~# su -l postgres~$ psqlpsql (11.1 ))Type "help" for help.postgres=#总结
以上是内存溢出为你收集整理的install postgresql11 on centos7全部内容,希望文章能够帮你解决install postgresql11 on centos7所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)