DEV Community

Cover image for Backup MySQL Database That Running on Docker Container
Luthfi Anandra
Luthfi Anandra

Posted on

11

Backup MySQL Database That Running on Docker Container

In this article, i want to share some information how to backup MySQL database that running on Docker Container.

The environment that i use is Ubuntu Linux running Docker container. MySQL is running on top of Docker container and mysql backup is using mysqldump.

Here are few steps, how to backup MySQL that running on Docker container:

  1. Check your MySQL container name

    Alt Text

  2. Backup your database using this command:

    docker exec [mysql_container_name] /usr/bin/mysqldump -u [mysql_username] --password=[mysql_password] [database_name] > [destination_path]

    Alt Text

  3. Verify your backup destination path. Make sure backup sql file has been added to destination

    Alt Text

API Trace View

How I Cut 22.3 Seconds Off an API Call with Sentry đź•’

Struggling with slow API calls? Dan Mindru walks through how he used Sentry's new Trace View feature to shave off 22.3 seconds from an API call.

Get a practical walkthrough of how to identify bottlenecks, split tasks into multiple parallel tasks, identify slow AI model calls, and more.

Read more →

Top comments (1)

Collapse
 
mirzasetiyono profile image
Mirza Setiyono •

mantep gan

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

đź‘‹ Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay