Docker - How can run the psql command in the postgres container?

前端 未结 6 1328
孤独总比滥情好
孤独总比滥情好 2020-12-22 18:44

I would like to use the psql in the postgres image in order to run some queries on the database. But unfortunately when I attach to the postgres container, I got that error

6条回答
  •  [愿得一人]
    2020-12-22 19:18

    This worked for me:

    goto bash :

    docker exec -it  bash
    

    from bash :

    psql -U  
    

    or just this one-liner :

    docker exec -it   psql -U  
    

    helps ?

提交回复
热议问题