1 of 12

MySQL with Docker Desktop

Mark Fontenot, PhD

Northeastern University

2 of 12

What is MySQL?

  • Most popular open source relational DBMS
  • Currently developed, distributed, and supported by Oracle (but still open source)
  • Fast, reliable, scalable
  • (Typically) deployed in a client/server setup
    • but there is an embedded version
  • MariaDB is a fork of MySQL by original MySQL devs… released under GNU GPL.

2

3 of 12

Client/Server Model of MySQL

3

MySQL Server

The Network/Internet

4 of 12

During Software Dev…

In a typical developer stack, the dev might need to have an instance of MySQL running on their machine…

Options:

- Direct Install

- Prepackaged executable (like XAMPP, etc)

- Containerization or VM

4

MySQL Server

5 of 12

Enter…. Docker!

  • Docker is a containerization platform
  • Allows you to package software into standardized units
    • ease of development
    • ease of shipment
    • ease of deployment
  • Similar to, but not exactly the same as, a virtual machine
  • Very widely used in industry
  • We’ll be using Docker Desktop
    • one click install of the Docker Engine, Docker CLI, Docker Compose and some other tools

5

6 of 12

Setting up Docker Desktop on Windows

  • Prerequisite for Windows: Install WSL 2
  • Follow the Install Interactively section under Install Docker Desktop for Windows

6

7 of 12

Setting up Docker Desktop on Mac

  • Important: Make sure you download the correct version based on your laptop’s processor (Intel chip or Apple Silicon Chip)
    • Apple Menu > About this Mac
  • Follow the Install Interactively* under Install and Run Docker Desktop for Mac

7

* Can’t have VirtualBox <= 4.3.30

8 of 12

Start Docker Desktop

8

9 of 12

9

unused

10 of 12

10

MYSQL_RANDOM_ROOT_PASSWORD

11 of 12

11

12 of 12

In Data Grip

  • New Data�source!

12