Articles → DOCKER → Create A Docker Container With Mysql Image And Execute Database Commands
Create A Docker Container With Mysql Image And Execute Database Commands
Prerequisite
Create A Container With Mysql Image
docker run --name my-mysql-container -e MYSQL_ROOT_PASSWORD=test -d -p 3306:3306 mysql
- my-mysql-container is the container name
- test is the mysql password
Execute Commands For Mysql
docker exec -it my-mysql-container sh
Click to Enlarge
Click to Enlarge