Set up MySQL with docker in windows

Lyheng Tep
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

--

--

Lyheng Tep
Lyheng Tep

Written by Lyheng Tep

Hi I am Lyheng. I am a software engineer from Cambodia. Coding is my passion. Find me at: https://lyhengtep.com

Responses (1)