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

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux postgresql默认安装目录,PostgreSQL for Linux 安装方式

發(fā)布時間:2023/12/19 linux 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux postgresql默认安装目录,PostgreSQL for Linux 安装方式 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

1、環(huán)境規(guī)劃

目錄名稱

存放位置

Postgres 用戶家目錄

/home/postgres

軟件存放目錄

/home/soft

安裝目錄

/usr/local

數(shù)據(jù)目錄

/home/postgres/data/

2、安裝流程

2.1 解壓安裝

在操作系統(tǒng)安裝完成后,按照表格規(guī)劃目錄。

1)安裝部署參考文檔

下載頁:https://www.enterprisedb.com/download-postgresql-binaries

軟件包:postgresql-10.7-2-linux-x64-binaries.tar.gz

2)創(chuàng)建 postgre 安裝用戶

useradd postgres

passwd postgres

3)創(chuàng)建 postgre 安裝目錄及數(shù)據(jù)目錄

mkdir -p /home/postgres/data/

chown -R postgres:postgres /home/postgres/data/

chmod -R 775 /home/postgres/data/

4)解壓安裝

tar -xvf postgresql-10.8-4-linux-x64-binaries.tar -C /home/postgres/

[root@leo postgres]# chmod -R 777 pgsql

[root@leo postgres]# ll

total 12

drwxrwxrwx 9 root root 4096 Apr 10 03:24 pgsql

drwx------ 19 postgres postgres 4096 Apr 15 11:33 pgsql_data

5)初始化數(shù)據(jù)庫

[postgres@leo bin]$cd /home/postgres/pgsql/bin

[postgres@leo bin]$ ./initdb -D /home/postgres/data/

The files belonging to this database system will be owned by user "postgres". This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8". The default database encoding has accordingly been set to "UTF8". The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /home/postgres/data ... ok creating subdirectories ... ok

selecting default max_connections ... 100

selecting default shared_buffers ... 128MB

selecting dynamic shared memory implementation ... posix creating configuration files ... ok

running bootstrap script ... ok

performing post-bootstrap initialization ... ok

syncing data to disk ... ok

WARNING: enabling "trust" authentication for local connections

You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using: ./pg_ctl -D /home/postgres/data/ -l logfile start

6)啟動數(shù)據(jù)庫

[postgres@leo bin]$ ./pg_ctl -D /home/postgres/data/ -l logfile start

waiting for server to start.... done

server started

7)停止數(shù)據(jù)庫

./pg_ctl -D /home/postgres/data/ stop

總結(jié)

以上是生活随笔為你收集整理的linux postgresql默认安装目录,PostgreSQL for Linux 安装方式的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。