PostgresSQL——编译安装

2022-06-18  本文已影响0人  wolfaherd

编译

git clone https://github.com/postgres/postgres.git
cd postgres/
yum -y install -y readline-devel
./configure --enable-debug
make clean && make -j

安装

启动前准备

make install -j

useradd postgres
passwd postgres

su - postgres
vim ~/.bash_profile
#在.bash_profile的末尾加入以下两行
export PATH=/usr/local/pgsql/bin:$PATH 
export LD_LIBRARY_PATH=/usr/local/pgsql/lib:$LD_LIBRARY_PATH
source ~/.bash_profile
rm -rf /home/postgres/data && initdb -D /home/postgres/data

启动与连接

pg_ctl -D /home/postgres/data -l logfile start
psql -d postgres -p 5432
上一篇 下一篇

猜你喜欢

热点阅读