BeJay
BeJay

Reputation: 425

How to stream a MySQL DB Dump from Docker

A docker container made a huge crawl and now the disk space from the VM is almost full. So, I need a solution to export the sql data without exceeding the disk space.

I already found a solution how I can create a MySQL dump in docker but in this post you would create a sql file which could be too big.

I am connected to the VM via ssh and can use the docker-cli. Do you know any solutions how I could kind of stream the data to my PC?

Upvotes: 0

Views: 203

Answers (1)

lain0
lain0

Reputation: 109

With docker: i have 2 projects deployed via docker-compose docker ps shows 2 mysql containers running: proj1-mysql-1 proj2-mysql-1 so i can directly:

docker exec -it proj1-mysql-1 mysqldump db_development |docker exec -i proj2-mysql-1 mysql db_development

With ssh you can do the same but run mysql via ssh

Upvotes: 1

Related Questions