Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
5 views
in DevOps and Agile by (2.3k points)
Hey there! How can I install mysql in docker?

1 Answer

0 votes
by (6.9k points)

Use this command to run a container with the mysql image:

$ sudo docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=<put your password here> -d mysql

Then get inside your docker container using this command:

$ sudo docker exec -it mysql bash

Once you are inside the container you can startup mysql using this command:

$ mysql -uroot -p

Enter the password you used while creating the container.

Now you should have a mysql server up and running.

Hope this helped :)


Got an interest in learning more about docker join docker training course.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Apr 1, 2020 in DevOps and Agile by chandra (29.3k points)

Browse Categories

...