mysqldump from a remote server with compression

suggest change

To compress the transfer, pass --compress. As of MySQL 8.0.18 that flag is deprecated; use --compression-algorithms=zlib on newer clients. Example:

mysqldump -h db.example.com -u username -p --compress dbname > dbname.sql

--lock-tables=false avoids a long read lock, but the dump can then mix old and new rows. For InnoDB, prefer --single-transaction --lock-tables=false, which uses one consistent snapshot. That does not make a consistent dump of MyISAM.

To also save the file compressed, you can pipe to gzip.

mysqldump -h db.example.com -u username -p --compress dbname | gzip --stdout > dbname.sql.gz

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents