Linux 上安装 PostgreSQL

在 Ubuntu/Debian 与 CentOS 上用包管理器安装 PostgreSQL 并初始化。

Beginner
Key PointsPostgreSQL,Linux,apt,yum,安装

讲解

在 Ubuntu/Debian 与 CentOS 上用包管理器安装 PostgreSQL 并初始化。

示例

SQL
sudo apt update && sudo apt install -y postgresql postgresql-contrib
sudo systemctl enable --now postgresql

# CentOS / RHEL
sudo yum install -y postgresql-server
sudo postgresql-setup initdb
sudo systemctl enable --now postgresql
Output
Synchronizing state of postgresql.service
Active: active (running)

Friends & Partners