Connect to mysql in a docker container from the host

后端 未结 14 803
青春惊慌失措
青春惊慌失措 2020-11-29 16:25

(It\'s probably a dumb question due to my limited knowledge with Docker or mysql administration, but since I spent a whole evening on this issue, I dare to ask it.)

14条回答
  •  失恋的感觉
    2020-11-29 16:53

    If you use "127.0.0.1" instead of localhost mysql will use tcp method and you should be able to connect container with:

    mysql -h 127.0.0.1 -P 3306 -u root
    

提交回复
热议问题