Files
chill_notes/数据库知识库/POSTGRESQL/Pg12 安装过程.md
2026-04-16 00:28:41 +08:00

18 lines
1.0 KiB
Markdown
Executable File
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
1. ==Install the repository RPM:========yum install== ==https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm==
2. ==Install the client packages:========yum install postgresql12==
3. ==Optionally install the server packages:========yum install postgresql12-server==
4. ==Optionally initialize the database and enable automatic start:========/usr/pgsql-12/bin/postgresql-12-setup initdb========systemctl enable postgresql-12========systemctl start postgresql-12== > 来自 <[https://www.postgresql.org/download/linux/redhat/](https://www.postgresql.org/download/linux/redhat/)>
[Service]
Type=notify
User=postgres
Group=postgres
# Note: avoid inserting whitespace in these Environment= lines, or you may
# break postgresql-setup.
# Location of database directory
Environment=PGDATA=/var/lib/pgsql/12/data/
初始化之后,数据文件会存在 /var/lib/pgsql/12/data
> 来自 <[https://www.postgresql.org/download/linux/redhat/](https://www.postgresql.org/download/linux/redhat/)>