A 500 MB database dump is mostly repeated text. Compressed, it might travel as 60 MB. On a slow connection that is the difference between a coffee break and an overnight download.
When you download databases in bulk, the download itself is usually the slow part, not the export. SQL text compresses extremely well because table names and structure repeat on every row. Here is how to make compression part of the export, not an extra chore after it.
An SQL dump repeats the same INSERT INTO line and column names thousands of times, and real-world data (names, addresses, product text) is ordinary language — exactly what gzip is good at squeezing. Reductions of 70–90 percent are normal for typical website databases. Media files stored as BLOBs compress less, because images are already compressed.
Piping mysqldump straight into gzip means the huge raw file never exists on disk — the server writes only the small file:
mysqldump -u dbuser -p mydatabase | gzip > mydatabase.sql.gz--all-databases --single-transaction --quick before the pipe.This also saves server disk space, which matters on a nearly-full hosting account.
Compression costs a little CPU on the server and saves a lot of download time — on any normal connection that trade wins easily. The one case to think twice: if your server CPU is already struggling and the download is local and fast, a raw dump can finish sooner end-to-end. For downloads over the internet, compressed wins in practice.
In phpMyAdmin's Export tab, choose the Custom method and set Compression: gzipped. The file arrives already compressed. The PHP time limits still apply to big databases — compression shrinks the download, it does not fix a timeout during export.
You do not need to extract it first. Feed it straight back:
gunzip < mydatabase.sql.gz | mysql -u dbuser -p mydatabaseKeep the .sql.gz naming habit — future-you will know exactly what the file is.
The full bulk database download process — live demo, every step on screen.
▶️ Watch Full VideoTypically 70 to 90 percent smaller for ordinary website data, because SQL text repeats so much. Databases storing lots of images as BLOBs shrink less, since image data is already compressed.
No. gzip is lossless — the decompressed file is byte-for-byte the original SQL. That is why the export-and-compress pipe is standard practice for backups and migrations.
Either works for storage. gzip is the natural partner on Linux servers because it streams through the pipe during export. Zip is fine if the file is already downloaded and you are archiving it on a Windows PC.