Connect to mysql in a docker container from the host

后端 未结 14 841
青春惊慌失措
青春惊慌失措 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:58

    For conversion,you can create ~/.my.cnf file in host:

    [Mysql]
    user=root
    password=yourpass
    host=127.0.0.1
    port=3306
    

    Then next time just run mysql for mysql client to open connection.

提交回复
热议问题