🗒️Docker安装PostgreSQL
00 分钟
2025-3-28
2025-4-2
type
status
date
slug
summary
tags
category
icon
password

拉取镜像

 

启动服务

 

连接数据库

创建新数据库

CREATE DATABASE mydb;

创建新用户

CREATE USER myuser WITH ENCRYPTED PASSWORD '123456';

授予用户权限

GRANT ALL PRIVILEGES ON DATABASE mydb TO myuser;
 
 
create table `department`(
)
 
insert into department(code,name) values(
'201','北京'
);
insert into department(code,name) values(
'205','深圳'
);