Before you go, check out these stories!

0
Hackernoon logoInstalling MySQL, PostgreSQL And MongDB Using Docker by@harrisonbrock

Installing MySQL, PostgreSQL And MongDB Using Docker

Author profile picture

@harrisonbrockHarrison Brock

Introduction

In this short tutorial, you will learn how to install MySQL, PostgreSQL, and MongoDB using Docker. If you do not have Docker installed you can down it here.

MySQL

Run the following command to install the latest version of MySQL:

docker container run -p 3306:3306 --name mysql-example-v /path/local/host:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=0123456789 -d mysql

PostgreSQL

Run the following command to install the latest version of PostgreSQL:

docker container run -d -p 5432:5432 --name pg-example -v /path/on/host:/var/lib/postgresql/data -e POSTGRES_DB=databaseName -e POSTGRES_PASSWORD=0123456789 postgres

MongoDB

Run the following command to install the latest version of MongoDB:

docker container run --name mongodb-example -v /path/local/host:/data/db -d -p 27017:27017 mongo

Conclusion

In this short tutorial, you learned how to install three different databases using Docker.

Tags

Join Hacker Noon

Create your free account to unlock your custom reading experience.