、解压postgresql-9.6.4.tar.gz文件
tar xvf postgresql-9.6.4.tar.gz
2、进入解压后的文件
postgresql在Linux下的安装
postgresql在Linux下的安装
3、安装数据库,./configure --prefix=路径
postgresql在Linux下的安装
注:遇到错误
1)、readline没找到
postgresql在Linux下的安装

 

postgresql在Linux下的安装
解决方法:
1、检查系统是否已经安装readline
postgresql在Linux下的安装
 postgresql在Linux下的安装

 

系统已经安装
2、通过yum搜索相应的readline包
 postgresql在Linux下的安装

 

postgresql在Linux下的安装
3、安装readline-devel 包
 postgresql在Linux下的安装

 

postgresql在Linux下的安装
2)、没找到zlib包
解决方法:
1、检查系统是否安装zlib包,系统已经安装zlib包
postgresql在Linux下的安装
 postgresql在Linux下的安装

 

2、通过yum搜索相应的yum包
postgresql在Linux下的安装
 postgresql在Linux下的安装

 

3、通过yum安装zlib-devel包
postgresql在Linux下的安装

 

4、重新执行安装语句,显示安装成功
5、执行make
6、执行make install
7、进入数据库安装目录,安装成功
postgresql在Linux下的安装

 

postgresql在Linux下的安装
8、创建postgres用户,并设置密码:postgres
postgresql在Linux下的安装

 

postgresql在Linux下的安装
9、创建data文件并设置权限
以递归的形式创建data文件
 postgresql在Linux下的安装

 postgresql在Linux下的安装

设置权限
postgresql在Linux下的安装
 
postgresql在Linux下的安装
 postgresql在Linux下的安装

postgresql在Linux下的安装

postgresql在Linux下的安装

10、进入以下文件,找到initdb文件
postgresql在Linux下的安装
 postgresql在Linux下的安装

postgresql在Linux下的安装

 

postgresql在Linux下的安装
11、初始化数据库,不能使用root用户,需要使用postgres用户
postgresql在Linux下的安装

 

postgresql在Linux下的安装
初始化成功
postgresql在Linux下的安装
postgresql在Linux下的安装
12、进入/u01/pgsql/data目录下修改文件配置
postgresql在Linux下的安装
postgresql在Linux下的安装
修改前
postgresql在Linux下的安装

 

postgresql在Linux下的安装
修改后
postgresql在Linux下的安装
 postgresql在Linux下的安装

postgresql在Linux下的安装

 

postgresql在Linux下的安装
修改前
postgresql在Linux下的安装
 postgresql在Linux下的安装

 

修改后
postgresql在Linux下的安装
 postgresql在Linux下的安装

 

 

13、修改环境配置
postgresql在Linux下的安装
 postgresql在Linux下的安装

postgresql在Linux下的安装

 

postgresql在Linux下的安装
14、设置环境变量立刻生效
postgresql在Linux下的安装
postgresql在Linux下的安装
15、执行pg_ctl start启动数据库服务
postgresql在Linux下的安装

 

16、执行pg_ctl stop关闭数据库服务
17、执行psql进入数据库命令行空间

相关文章:

  • 2021-11-27
  • 2022-12-23
  • 2021-09-01
  • 2022-01-10
  • 2021-11-07
  • 2022-12-23
  • 2022-12-23
  • 2021-08-15
猜你喜欢
  • 2022-01-28
  • 2022-01-14
  • 2022-12-23
  • 2021-11-09
  • 2021-11-29
相关资源
相似解决方案