RUN 文件安装PostgreSQL(Linux)

本文详细介绍了如何通过RUN文件在Linux系统中安装PostgreSQL数据库,包括下载特定版本的RUN文件,将文件复制到服务器,创建并配置用户组和用户,安装过程,修改pg_hba.conf文件以允许远程连接,以及启动、停止服务和连接数据库的步骤。
摘要由CSDN通过智能技术生成

RUN 文件安装PostgreSQL(Linux)

1.下载RUN文件

下载版本:postgresql-10.15-1-linux-x64
下载地址:

https://www.enterprisedb.com/downloads/postgres-postgresql-downloads

2.文件复制到Linux服务器run文件

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
  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值