Deploy MySQL as Docker instance

Dhruv Saksena
Apr 28, 2021

--

This is pretty much pretty straightforward. The objective is to deploy MySQL as a Docker container.

First, we will download the image from Docker hub-

docker pull mysql/mysql-server:latest

Now, we will create a container out of it-

docker run --name=demo-mysql -d mysql/mysql-server:latest

To get the root password for it, just see MySQL logs

docker logs

Now, get the container-id with command

docker ps

Login to MySQL

docker exec -it  <container-id> mysql -uroot -p<root-password>

That's it !!

--

--

No responses yet