CentOS6.9 PostgreSQL9.5.7 ソースからコンパイルしてインストールする
を参考に
Firewall 5432 port をopen
vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5432 -j ACCEPT
/etc/init.d/iptables restart
vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5432 -j ACCEPT
/etc/init.d/iptables restart
yum -y install gcc
yum -y install readline
yum -y install readline-devel
yum -y install zlib
yum -y install zlib-devel
cd /usr/local
wget https://ftp.postgresql.org/pub/source/v9.5.7/postgresql-9.5.7.tar.gz
tar xvfz postgresql-9.5.7.tar.gz
cd postgresql-9.5.7
./configure
make
-------------------------------------------------------------------------------
yum install gccが抜けていると
You need to run the 'configure' program first. See the file
'INSTALL' for installation instructions.
'INSTALL' for installation instructions.
--------------------------------------------------------------------------------------------------------------------------------------------------------------
を参考に
mkdir /opt/postgresql
./configure --prefix=/opt/postgresql
---------------------------------------------------------------------------------------
[root@localhost postgresql-9.3.9]# ls -l /opt/postgresql
合計 16
drwxr-xr-x. 2 postgres postgres 4096 5月 22 18:06 2017 bin
drwxr-xr-x. 6 postgres postgres 4096 5月 22 18:06 2017 include
drwxr-xr-x. 4 postgres postgres 4096 5月 22 18:06 2017 lib
drwxr-xr-x. 6 postgres postgres 4096 5月 22 18:06 2017 share
[root@localhost postgresql-9.3.9]# sudo gedit /home/postgres/.bash_profile
[root@localhost postgresql-9.3.9]# su - postgres
[postgres@localhost ~]$ env | grep PGDATA
PGDATA==/opt/postgresql/data
[postgres@localhost ~]$ initdb --encoding=UTF8 --no-locale
-bash: initdb: コマンドが見つかりません
[postgres@localhost ~]$
合計 16
drwxr-xr-x. 2 postgres postgres 4096 5月 22 18:06 2017 bin
drwxr-xr-x. 6 postgres postgres 4096 5月 22 18:06 2017 include
drwxr-xr-x. 4 postgres postgres 4096 5月 22 18:06 2017 lib
drwxr-xr-x. 6 postgres postgres 4096 5月 22 18:06 2017 share
[root@localhost postgresql-9.3.9]# sudo gedit /home/postgres/.bash_profile
[root@localhost postgresql-9.3.9]# su - postgres
[postgres@localhost ~]$ env | grep PGDATA
PGDATA==/opt/postgresql/data
[postgres@localhost ~]$ initdb --encoding=UTF8 --no-locale
-bash: initdb: コマンドが見つかりません
[postgres@localhost ~]$
---------------------------------------------------------------------------------------
-bash: initdb: コマンドが見つかりません