离线安装postgresql和postgis

离线安装postgresql和postgis

安装postgres

1.解压postgresql安装包

tar -zxvf postgresql-10.20.tar.gz

2.在postgresql目录下执行(依次执行命令)

./configure
Make && make install
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 &
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test

安装postgis
前往此链接查看:https://blog.csdn.net/moshi_09/article/details/108830377?spm=1001.2101.3001.6650.2&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-2.pc_relevant_antiscanv2&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-2.pc_relevant_antiscanv2&utm_relevant_index=5

你可能感兴趣的:(linux安装环境,postgresql,数据库,database)