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
3 Yum list List of available PostgreSQL resources
list postgresql*
4 Install Postgresql-server, other tools can be installed on demand
-y postgresql10-server.x86_64
5 Database initialization
service postgresql-10 initdb
6 Starting the database service
startchkconfig postgresql-10 on
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