How to Save Docker Data using Bind Mounts or Volumes

Published: 22 February 2022
on channel: Database Star
31,299
639

📝 Get your FREE cheat sheet of Docker commands: https://www.databasestar.com/docker-d...
🎓 Master SQL Fundamentals: https://databasestar.mykajabi.com/sql...

Using Docker for a database is common during development. It’s easy to set up, and it’s available for many different types of databases.

One drawback is that the data is not saved when the container is removed.

However, there are two methods that can be used to save data in Docker if a container is removed.

These methods are Volumes and Bind Mounts.

In this video, I’ll explain what they are and show you how to set up a container to use each of them.

We’ll use a MySQL database to demonstrate that the database is saved between containers, but this works on many different databases.

This video assumes you have Docker set up already. If not, you can check out any of my other videos:

How to Set Up Docker with Oracle:    • How to Set Up Oracle Database with Do...  
How to Set Up Docker with SQL Server:    • How to Set Up SQL Server Database wit...  
How to Set Up Docker with MySQL:    • How to Set Up MySQL Database with Docker  
How to Set Up Docker with PostgreSQL:    • How to Set Up a PostgreSQL Database w...  

Timestamps:
00:00 Introduction
00:16 Docker storage options
01:05 Definitions
01:40 Prerequisites for this video
02:02 Option 1: Create volume
03:00 Docker run with volume
04:35 Add data to database
06:16 Remove and create new container
08:42 Option 2: Create bind mount
09:26 Docker run with bind mount
10:54 Add data to database
11:58 Remove and create new container


Watch video How to Save Docker Data using Bind Mounts or Volumes online without registration, duration hours minute second in high quality. This video was added by user Database Star 22 February 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 31,299 once and liked it 639 people.