Docker & Postgres: Failed to bind tcp 0.0.0.0:5432 address already in use

后端 未结 5 1102
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-30 22:38

Problem

I\'m trying to start postgres in a docker container on my Mac, but I keep getting the following error message

docker: Error response from da

5条回答
  •  故里飘歌
    2021-01-30 22:58

    The first thing you should do is stop PostgreSQL service. In most cases it fixed the issue.

    sudo service postgresql stop
    

    If above doesn't work. then add the following line to /etc/postgresql/12/main/postgresql.conf

    sudo vim /etc/postgresql/12/main/postgresql.conf
    
    ## good if you add under CONNECTION AND AUTHENTICATION comments
    listen_addresses = "*"
    

提交回复
热议问题