Member-only story

Docker Compose MySQL Multiple Database

Onexlab
3 min readJul 3, 2020

--

Docker Compose MySQL Multiple Database

Docker Compose MySQL Multiple Database

Video Tutorial

In this article, We will explain to you how to set up MySQL following multiple databases using Docker-Compose

  1. root (use can use it for local development)
  2. test (use can use it for testing)

Production Env:

The production database environment. You can use cloud databases such as AWS RDS, Heroku, etc.

Development Env:

A dedicated environment for database for local development.

Test Env:

A dedicated environment for database testing.

Onexlab Udemy

Why we need multiple databases?

If you have only a Production Database and you are developing a new feature if something breaks it will affect the whole Production Database.

For best practice, You must have a different Database Development Environment because if you are developing a new feature in a Development Environment if something breaks it will not impact on Production Database Environment.

Let’s Start Creating Multiple Environment Database

Hope you are familiar with “Docker-Compose”

Folder structure

Project
├── docker-compose.yml (File)
├── init (Directory)
│ ├── 01.sql (File)

--

--

Onexlab
Onexlab

Responses (2)

Write a response