Set up MySQL with docker in windows
Feb 3, 2021
First, you have to make sure that you have docker installed on your local machine. if you don’t please install it (https://docs.docker.com/docker-for-windows/install/ ).
After that run the command below:
docker run --name some-mysql -p3306:3306 -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:tag
specify the tag number or put the “latest” there for the MySQL image.
if you want to view your container is running or not then run:
docker ps
If you want to login to your MySQL that is running inside the container
docker exec -it your_container_name mysql -uroot -pyour_pw