日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux32安装pgsql,Linux安装pgsql

發布時間:2025/3/21 linux 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux32安装pgsql,Linux安装pgsql 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

作者QQ:67065435 QQ群:821635552

安裝前的準備 yum install \

vim \

wget \

firewalld \

gcc \

gcc-c++ \

openssl-devel \

readline \

readline-devel \

zlib \

zlib-devel \

uuid-devel \

systemd-devel \

-y

安裝PostGreSQL cd /home

wget https://ftp.postgresql.org/pub/source/v10.3/postgresql-10.3.tar.gz

tar -zxvf postgresql-10.3.tar.gz

cd postgresql-10.3

./configure \

--prefix=/usr/local/postgres/ \

--with-ossp-uuid \

--with-uuid=ossp \

--with-systemd \

--with-openssl \

make

make install

添加postgres用戶并配置數據目錄 mkdir /data/

mkdir /data/postgres/

useradd postgres

chown -R postgres:postgres /data/postgres/

chown -R postgres:postgres /usr/local/postgres/

chown -R postgres:postgres /home/postgresql-10.3/

配置啟動防火墻 systemctl start firewalld

firewall-cmd --zone=public --add-port=5432/tcp --permanent

firewall-cmd --reload

修改環境變量 vim /etc/profile

export PGHOME=/usr/local/postgres

export PGDATA=/data/postgres

export PATH=$PATH:/usr/local/postgres/bin

ESC

:wq

source /etc/profile

初始化數據庫 su postgres

/usr/local/postgres/bin/initdb -D /data/postgres

修改配置 su postgres

vim /data/postgres/pg_hba.conf

local all all trust

host all all 127.0.0.1/32 trust

host all all 0.0.0.0/0 trust

host all all ::1/128 trust

local replication all trust

host replication all 127.0.0.1/32 trust

host replication all 0.0.0.0/0 trust

host replication all ::1/128 trust

ESC

:wq

vim /data/postgres/postgresql.conf

listen_addresses = '*'

ESC

:wq

啟動 su postgres

/usr/local/postgres/bin/pg_ctl -D /data/postgres -l logfile start

創建默認數據庫及設置密碼 su postgres

/usr/local/postgres/bin/createdb postgres

/usr/local/postgres/bin/psql postgres

# 已經進入了postgres控制臺

\password

# 接下來輸入密碼

12345678

# 退出

\q

停止、啟動、重啟、重載 su postgres

/usr/local/postgres/bin/pg_ctl -D /data/postgres -l logfile stop

/usr/local/postgres/bin/pg_ctl -D /data/postgres -l logfile start

/usr/local/postgres/bin/pg_ctl -D /data/postgres -l logfile restart

/usr/local/postgres/bin/pg_ctl -D /data/postgres -l logfile reload

總結

以上是生活随笔為你收集整理的linux32安装pgsql,Linux安装pgsql的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。