RUN 文件安装PostgreSQL(Linux)
1.下载RUN文件
下载版本:postgresql-10.15-1-linux-x64
下载地址:
https://www.enterprisedb.com/downloads/postgres-postgresql-downloads
2.文件复制到Linux服务器
3.添加用户组和用户
1、安装过删除postgres用户和他的文件信息
userdel -r postgres
2、删除postgres用户组(如果之前安装过)
groupdel postgres
(1)新增postgres用户组:
groupadd postgres
(2)新增postgres用户并且设置这个用户属于上面创建的postgres用户组:
useradd -g postgres postgres
(3)修改postgres用户密码:passwd postgres(这里设置密码为postgres)
passwd postgres --修改postgres用户密码
4.安装PostgreSQL
(1)更改run 文件的权限
[root@bugtracking ~]# chmod +x postgresql-10.15-1-linux-x64.run
(2)运行run文件
[root@bugtracking ~]# ./postgresql-10.15-1-linux-x64.run
----------------------------------------------------------------------------
Welcome to the PostgreSQL Setup Wizard.
----------------------------------------------------------------------------
Please specify the directory where PostgreSQL will be installed.
Installation Directory [/opt/PostgreSQL/10]:
----------------------------------------------------------------------------
Select the components you want to install; clear the components you do not want
to install. Click Next when you are ready to continue.
PostgreSQL Server [Y/n] :y
pgAdmin 4 [Y/n] :y
Stack Builder [Y/n] :y
Command Line Tools [Y/n] :y
Is the selection above correct? [Y/n]: y
----------------------------------------------------------------------------
Please select a directory under which to store your data.
Data Directory [/opt/PostgreSQL/10/data]:
----------------------------------------------------------------------------
Please provide a password for the database superuser (postgres). A locked Unix
user account (postgres) will be created if not present.
Password :
Retype password :
----------------------------------------------------------------------------
Please select the port number the server should listen on.
Port [5432]:
----------------------------------------------------------------------------
Advanced Options
Select the locale to be used by the new database cluster.
Locale
[1] [Default locale]
[1] aa_DJ
[3] aa_DJ.iso88591
[4] aa_DJ.utf8
[5] aa_ER
[6] aa_ER@saaho
[7] aa_ER.utf8
[8] aa_ER.utf8@saaho
[9] aa_ET
[10] aa_ET.utf8
[11] af_ZA
[12] af_ZA.iso88591
[13] af_ZA.utf8
[14] am_ET
[15] am_ET.utf8
[16] an_ES
[17] an_ES.iso885915
[18] an_ES.utf8
[19] ar_AE
[20] ar_AE.iso88596
[21] ar_AE.utf8
[22] ar_BH
[23] ar_BH.iso88596
[24] ar_BH.utf8
[25] ar_DZ
[26] ar_DZ.iso88596
[27] ar_DZ.utf8
[28] ar_EG
[29] ar_EG.iso88596
[30] ar_EG.utf8
[31] ar_IN
[32] ar_IN.utf8
[33] ar_IQ
[34] ar_IQ.iso88596
[35] ar_IQ.utf8
[36] ar_JO
[37] ar_JO.iso88596
[38] ar_JO.utf8
[39] ar_KW
[40] ar_KW.iso88596
[41] ar_KW.utf8
[42] ar_LB
[43] ar_LB.iso88596
[44] ar_LB.utf8
[45] ar_LY
[46] ar_LY.iso88596
[47] ar_LY.utf8
[48] ar_MA
[49] ar_MA.iso88596
[50] ar_MA.utf8
[51] ar_OM
[52] ar_OM.iso88596
[53] ar_OM.utf8
[54] ar_QA
[55] ar_QA.iso88596
[56] ar_QA.utf8
[57] ar_SA
[58] a