I use docker to work with two mysql (5.5, 5.7). I want to connect the database to the IDE, but I don’t know which hostname to use. If I look at the ports that are busy and hosts, it displays

tcp6 0 0 ::: 3306 ::: *
LISTEN 14740 / docker-proxy

    1 answer 1

    Forward ports to localhost.

    # docker-compose.yml ports: - 3306:3306 

    Or docker run -p 3306:3306

    Left port on localhost. In another container, do 3307 or any other not occupied. Use localhost:3306 or 3307 (etc).