linux 安装postgresql教程

linux 安装postgresql教程

下载软件

pgsql官网地址:https://www.postgresql.org/,进入后点击download就来到下载页,这里点击Linux下面的Other Linux选项,然后点击下方的tar.gz archive下载二进制归档,

linux 安装postgresql教程

linux 安装postgresql教程

创建文件夹

mkdir /monchickey/pgsql_data

用户授权目录访问权限

chown postgres /monchickey/pgsql_data/

文件传至文件夹下进行解压

*tar -xvzf postgresql-10.1-1-linux-x64-binaries.tar.gz

设置密码

useradd postgres
passwd postgres

配置.bash_profile

linux 安装postgresql教程

进行初始化
/monchickey/pgsql/bin/initdb -D /monchickey/pgsql_data/

linux 安装postgresql教程

启动

/monchickey/pgsql/pgsql/bin/pg_ctl -D /monchickey/pgsql_data/ -l logfile start
ps -ef | grep postgres
linux 安装postgresql教程
查看 lsof -i:5432
linux 安装postgresql教程

linux 安装postgresql教程