Docker 安装 PostgreSQL
作者:互联网
Docker 安装 PostgreSQL
docker run -it \
--name postgres \
--restart always \
-e POSTGRES_PASSWORD='123456' \
-e ALLOW_IP_RANGE=0.0.0.0/0 \
-p 5433:5432 -d postgres
docker exec -it postgres /bin/bash
su postgres
psql
-- 创建用户
CREATE USER monitor WITH PASSWORD '123456';
-- 创建数据库
CREATE DATABASE testdb OWNER monitor ENCODING 'UTF8';
-- 授权
GRANT ALL PRIVILEGES ON DATABASE testdb TO monitor;
标签:PostgreSQL,postgres,--,0.0,testdb,Docker,123456,安装,monitor 来源: https://www.cnblogs.com/eoalfj/p/15589248.html