安装PG

mac

查看版本列表

brew search postgresql

安装

# 安装默认版本:14
brew install postgresql

启动服务

brew services start postgresql@14

添加环境变量

echo 'export PATH="/opt/homebrew/opt/postgresql@14/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

登录

默认用户为与执行安装的用户同名,无密码。

psql -d postgres

设置密码

centos

安装脚本

安装后信息

Last updated