install postgresql11 on centos7
Step 2: Add EPEL repository to CentOS 7A 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-release Step 3: Install PostGIS on CentOS 7After 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_11 Step 4: Enable PostGIS Spatial featuresYou 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.
sudo -i -u postgres
-bash-4.2$ createuser test_user
? 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.rpm Step 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 initdb Initializing 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.service Step 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 ~$ psql psql (11.1 )) Type "help" for help. postgres=# (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |