Helpful MySQL shell tricks

Although I’m Windows user most of the time, I have to take care of some projects on Linux boxes, so it’s good to have at least a little knowledge of what you’re doing there.

The pipe really is a helpful little tool, which allows to do a mysqldump and directly gzip the result:

mysqldump my_database | gzip > my_dump.sql.gz

This surely saves some time during late night deploys!

You can even do a mysqldump from one server to another:

mysqldump my_database | ssh user@12.34.567.89 "cat >> /tmp/my_dump.sql"