SQL Dump in Docker

greenteabiscuit

Reishi Mitani

Posted on September 12, 2020

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
๐Ÿ’– ๐Ÿ’ช ๐Ÿ™… ๐Ÿšฉ
greenteabiscuit
Reishi Mitani

Posted on September 12, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

ยฉ TheLazy.dev

About