DEV Community

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

Posted on

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

Top comments (1)

Collapse
 
mirzasetiyono profile image
Mirza Setiyono

mantep gan