docker安装的postgresql的密码是否自动更改?

问题描述

我使用以下命令创建了postgresql码头

docker run -d -p 5432:5432 --name postgres -e POSTGRES_PASSWORD=1234 -v pgdata:/var/lib/postgresql/data postgres

但是一段时间后,发生以下错误

[575] FATAL:  password authentication Failed for user "postgres"
[575] DETAIL:  Password does not match for user "postgres".
Connection matched pg_hba.conf line 95: "host all all all md5"

运行以下命令,它将再次运行

docker exec postgres su - postgres -c "psql -U postgres -d postgres -c \"alter user postgres with password '1234';\""

你能告诉我为什么会这样吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)