In this video, I’ll show you how to set up and run MySQL inside a Docker container from scratch. Whether you’re a beginner or looking for a quick reference, this tutorial will guide you through every step.
🔥 What You’ll Learn:
✅ How to pull the MySQL Docker image
✅ How to run the container with environment variables
✅ How to map ports for external access
✅ How to check running containers with docker ps
✅ How to access MySQL inside the container
📌 Commands Used in This Video:
1️⃣ Pull MySQL Image:
docker pull mysql
2️⃣ Run MySQL Container:
docker run --name my-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -p 3333:3306 -d mysql:latest
3️⃣ Check Running Containers:
docker ps
4️⃣ Access MySQL Inside Container:
docker exec -it (container_id) sh
mysql -p
Install docker on windows :
https://youtu.be/ZyBBv1JmnWQ?si=Q7A4LpD0CZvm0Wpy
Install docker on mac :
https://youtu.be/uDkf1fSPlYQ?si=b3FduTL2h4bqn4Ff