将postgresql-10.1.tar.gz上传到/home下 运行解压命令 tar -zxvf postgresql-10.1.tar.gz
2)检查当前系统环境能否安装PG
1 2
cd /home/postgresql-10.1/ ./configure --prefix=/usr/local/pgsql/
若出现下述错误
1 2 3 4
configure: error: readline library not found If you have readline already installed, see config.log for details on the failure. It is possible the compiler isn't looking in the proper directory. Use --without-readline to disable readline support.
执行下述命令
1
yum -y install -y readline-devel
若再次运行./configure命令,出现下述问题
1 2 3 4
configure: error: zlib library not found If you have zlib already installed, see config.log for details on the failure. It is possible the compiler isn't looking in the proper directory. Use --without-zlib to disable zlib support.
进入目录:/home/deployer/postgresql-10.1/contrib make && make install
注意:若出现下述问题,请检查防火墙是否开放5432端口权限
1 2 3 4
Unable to connect to server: could not connect to server: Connection timed out (0x0000274C/10060) Is the server running on host "192.168.1.205" and accepting TCP/IP connections on port 5432