Unable to connect to MYSQL from Docker Instance

后端 未结 1 1214
抹茶落季
抹茶落季 2021-01-14 08:01

I\'m new to Docker and pulled the mysql from the docker hub using following command

docker pull mysql
1条回答
  •  失恋的感觉
    2021-01-14 08:12

    Get in the docker container using the following command

    docker exec -it mysql bash
    

    You can then easily connect to MySQL, by executing the following command

    mysql -uroot -p
    

    If you are trying to connect from the host machine, then you will have to install the mysql client. On mac, the command is as follows

    brew install mysql
    

    0 讨论(0)
提交回复
热议问题