DEV Community

Reishi Mitani
Reishi Mitani

Posted on

1 1

SQL Dump in Docker

First, enter your mysql docker container.

// in your local machine
$  docker exec -it up_mysql_1 /bin/bash
Enter fullscreen mode Exit fullscreen mode

Dump your file.

# mysqldump -u root -p DB_NAME > outputfile.sql
Enter fullscreen mode Exit fullscreen mode

The file will be dumped in your docker container.
Transport the file to your local machine using the following command.

// in your local machine
$ docker cp CONTAINER_ID:/outputfile.sql ~/Documents/outputfile.sql
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more