0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

DjangoでDatabase is uninitialized and superuser password is not specified.となった

Posted at

###環境

  • wsl
  • docker
  • docker-compose
  • postgresql
  • django

エラーメッセージ

Database is uninitialized and superuser password is not specified.
db_1 | You must specify POSTGRES_PASSWORD to a non-empty value for the
db_1 | superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
db_1 |
db_1 | You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
db_1 | connections without a password. This is not recommended.

POSTGRES_HOST_AUTH_METHODという環境変数をtrustとすれば一応できるみたいなので

#解決法
docker-compose.ymlを

db:
    image: postgres
    environment:
        - POSTGRES_HOST_AUTH_METHOD=trust

のようにしました。
本来はパスワードを設定するべきのようですね。

#参考文献
https://qiita.com/tomopict/items/23cc4332781bb28d2973

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?