Ste*_*evy 5 postgresql docker docker-compose
我正在使用 docker 运行 Postgres 图像。它曾经在 Windows10 和 Ubuntu 18.04 上运行没有任何问题。
在 Ubuntu 系统上重新克隆项目password authentication failed for user "postgres"后,运行docker-compose up.
在Ubuntu系统上重新克隆项目之前,它曾经运行没有任何问题,它在Windows10系统上仍然可以正常运行。
我的docker-compose.yml:
version: '2'
services:
postgresql:
image: 'bitnami/postgresql:latest'
ports:
- '5432:5432'
environment:
- POSTGRESQL_USERNAME=someuser
- POSTGRESQL_PASSWORD=mysecretpassword
- POSTGRESQL_DATABASE=mydatabase
Run Code Online (Sandbox Code Playgroud)
我试图sudo docker system prune删除所有停止的容器及其未使用的网络。这并不能解决问题。
我需要更改/做什么才能使 Postgres 映像能够再次在 Ubuntu 系统上成功运行?
完整的错误:
postgresql_1 | nami INFO Initializing postgresql
postgresql_1 | postgre INFO ==> No injected postgresql.conf file found.
Creating default postgresql.conf file...
postgresql_1 | postgre INFO ==> No injected pg_hba.conf file found. Creating default pg_hba.conf file...
postgresql_1 | postgre INFO ==> Deploying PostgreSQL from scratch...
postgresql_1 | postgre INFO ==> Creating database mydatabase...
postgresql_1 | postgre INFO ==> Creating user "someuser"...
postgresql_1 | postgre INFO ==> Granting access to "someuser" to the database mydatabase...
postgresql_1 | postgre INFO ==> Configuring PostgreSQL...
postgresql_1 | postgre INFO ==> Configuring replication parameters...
postgresql_1 | postgre INFO ==> Configuring permissions for config files...
postgresql_1 | postgre INFO
postgresql_1 | postgre INFO
########################################################################
postgresql_1 | postgre INFO Installation parameters for postgresql:
postgresql_1 | postgre INFO User: someuser
postgresql_1 | postgre INFO Password: ***************
postgresql_1 | postgre INFO Database: mydatabase
postgresql_1 | postgre INFO (Passwords are not shown for security reasons)
postgresql_1 | postgre INFO
########################################################################
postgresql_1 | postgre INFO
postgresql_1 | nami INFO postgresql successfully initialized
postgresql_1 | INFO ==> Starting postgresql...
postgresql_1 | 2019-04-15 09:31:18.582 GMT [125] LOG: listening on IPv4 address "0.0.0.0", port 5432
postgresql_1 | 2019-04-15 09:31:18.583 GMT [125] LOG: listening on IPv6 address "::", port 5432
postgresql_1 | 2019-04-15 09:31:18.587 GMT [125] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432"
postgresql_1 | 2019-04-15 09:31:18.599 GMT [132] LOG: database system was shut down at 2019-04-15 09:31:18 GMT
postgresql_1 | 2019-04-15 09:31:18.603 GMT [125] LOG: database system is ready to accept connections
postgresql_1 | 2019-04-15 09:31:24.414 GMT [139] FATAL: password authentication failed for user "postgres"
postgresql_1 | 2019-04-15 09:31:24.414 GMT [139] DETAIL: User "postgres" has no password assigned.
postgresql_1 | Connection matched pg_hba.conf line 95: "host all all 0.0.0.0/0 md5"
postgresql_1 | 2019-04-15 09:31:27.492 GMT [140] FATAL: password authentication failed for user "postgres"
postgresql_1 | 2019-04-15 09:31:27.492 GMT [140] DETAIL: User "postgres" has no password assigned.
Run Code Online (Sandbox Code Playgroud)
如果您查看 docker 映像的文档(https://hub.docker.com/r/bitnami/postgresql),它会说当您设置POSTGRESQL_USERNAMEpostgres 用户时,将不会分配密码,您将无法使用它登录到数据库。
使用您指定的用户。
| 归档时间: |
|
| 查看次数: |
8106 次 |
| 最近记录: |