Mac 下安装PostgreSQL经验

使用homebrew终端软件管理器去安装PostgreSQL

如果没有安装brew命令执行以下命令

复制代码
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

沙果开源物联网系统 SagooIoT | SagooIoT

1.使用命令安装postgreSQL

复制代码
brew install postgresql

安装完成后显示:

校验一下postgreSQL 版本号

复制代码
brew list

起动postgreSQL

复制代码
brew services start postgresql


brew services list

将得到postgresql status -> srarted

此时 postgreSQL就安装完毕,使用客户端工具免密登录

初始化:

initdb /usr/local/postgresql -E utf8

创建postgres 用户角色

复制代码
CREATE ROLE postgres WITH LOGIN SUPERUSER;

完成后登录postgresql

复制代码
psql -U postgres

#退出
quit

创建用户 并设置密码

复制代码
psql -U postgres ;

ALTER USER postgres WITH PASSWORD 'postgres';

PostgreSQL 目前在学习的IOT物联网平台 沙果开源物联网系统 SagooIoT | SagooIoT 项目中使用到

沙果开源物联网系统 SagooIoT | SagooIoT

相关推荐
脑子进水养啥鱼?5 小时前
PostgreSQL .history 文件
数据库·postgresql
日取其半万世不竭11 小时前
PostgreSQL 云服务器安装配置指南:从零开始搭建生产数据库
服务器·数据库·postgresql
审判长烧鸡11 小时前
GO时区【4】PostgreSQL时区
postgresql·go
审判长烧鸡13 小时前
GO时区【3】字段与连接设置
postgresql·go
qq_2837200513 小时前
Python3 模块精讲:psycopg2(第三方)- 连接 PostgreSQL
数据库·postgresql
Mr.朱鹏1 天前
【Python 进阶 | 第四篇】Psycopg3 + Flask 实现 PostgreSQL CRUD 全流程:从连接池到RESTful接口
python·postgresql·flask·virtualenv·fastapi·pip·tornado
瀚高PG实验室2 天前
pgroonga全文检索插件的BUG
数据库·postgresql·bug·瀚高数据库
hudson20223 天前
Postgres 实现自增的三种方式
postgresql
dblens 数据库管理和开发工具3 天前
DBLens for PostgreSQL 正式发布|把 PostgreSQL 开发与管理带进 AI + Agent 时代
数据库·人工智能·postgresql
l1t3 天前
DeepSeek总结的面向 PostgreSQL 分析和 HTAP 工作负载的两种高性能表访问方法
数据库·postgresql