Tag Archives: one-liner

Clone-a-database one-liner

9 May

I had to clone a remote MySQL database into my Ubuntu notebook, and I just felt like doing a one-liner for it.

$ mysqladmin -f -uroot create sandbox &&
ssh luisfarzati@mydatabasehost.com "mysqldump -uroot sandbox | gzip -f" | gunzip | mysql -uroot sandbox

Advertisements
%d bloggers like this: