CentOS6 Online Installation PostgreSQL10

Source: Internet
Author: User
Tags postgresql

In this paper, we introduce how to install PostgreSQL10 in CentOS6 environment and install the installation environment with Yum Online installation function. The specific installation steps are as follows

1 Download the corresponding version of the PGDG file
Find the corresponding version from the https://yum.postgresql.org/repopackages.php page and use the https://download.postgresql.org/pub/repos/yum/10/ redhat/rhel-6-x86_64/pgdg-centos10-10-2.noarch.rpm

2 Install the above PGDG file

https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-6-x86_64/pgdg-centos10-10-2.noarch.rpm
    • 1

3 Yum list List of available PostgreSQL resources

list postgresql*
    • 1

4 Install Postgresql-server, other tools can be installed on demand

-y postgresql10-server.x86_64
    • 1

5 Database initialization

service postgresql-10 initdb
    • 1

6 Starting the database service

startchkconfig postgresql-10 on
    • 1
    • 2

7 Connecting the Psql client

[[email protected] ~]# su - postgres-bash-4.1$ psqlpsql (10.1)Type "help" for help.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 installation of PostgreSQL 10 has been completed, you can try different commands later, a few common commands are listed below, for reference only:

//创建数据库-bash-4.1$ createdb ly//删除数据库-bash-4.1$ dropdb ly//创建用户-bash-4.1$ createuser ly//删除用户-bash-4.1$ dropuser ly



转: 78920190

CentOS6 Online Installation PostgreSQL10

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.