sudo docker pull postgres
mkdir -p /data/docker/pgsql
sudo docker run -p 54321:5432 --name pgsql -v /data/docker/pgsql:/var/lib/postgresql -d postgres
sudo docker start pgsql

sudo docker exec -it pgsql bash
psql -U postgres

ALTER USER postgres WITH PASSWORD '新密码';

\q
exit
posted on 2018-11-09 10:06 nicye 阅读(...) 评论(...) 编辑 收藏