PostgresSQL ---- 编译安装

编译

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
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容