DEV Community

loading...
Cover image for Backup MySQL Database That Running on Docker Container

Backup MySQL Database That Running on Docker Container

lanandra profile image Luthfi Anandra ・1 min read

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

Discussion (0)

pic
Editor guide