2026-03-12 21:01:38
This commit is contained in:
36
postgresql/pg_install_01.txt
Normal file
36
postgresql/pg_install_01.txt
Normal file
@@ -0,0 +1,36 @@
|
||||
dnf install -y gcc.x86_64 make.x86_64 readline.x86_64 readline-devel.x86_64 zlib-devel.x86_64 zlib.x86_64 openssl-devel.x86_64
|
||||
|
||||
./configure \
|
||||
--prefix=/app/postgres/15.3 \
|
||||
--datarootdir=/data \
|
||||
--with-ssl=openssl
|
||||
|
||||
make
|
||||
make install
|
||||
|
||||
useradd postgres-G postgres -g postgres
|
||||
useradd postgres -G postgres -g postgres
|
||||
|
||||
chown -R postgres:postgres /app/postgres /data /backup
|
||||
|
||||
pg_ctl -D /data/postgresql/dbf -l logfile start
|
||||
|
||||
|
||||
# add to .bash_profile
|
||||
|
||||
export PS1="\u@\h:\w> "
|
||||
alias listen='lsof -i -P | grep -i "listen"'
|
||||
|
||||
export POSTGRES_HOME=/app/postgres/15.3
|
||||
export PGDATA=/data/postgresql/dbf
|
||||
|
||||
export LD_LIBRARY_PATH=$POSTGRES_HOME/lib:$LD_LIBRARY_PATH
|
||||
export PATH=$POSTGRES_HOME/bin:$PATH
|
||||
|
||||
|
||||
# init database and startup
|
||||
initdb
|
||||
pg_ctl -D /data/postgresql/dbf -l /home/postgres/postgres.log start
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user