Import MySql dump with progress indicator — Linux

We’ll take the default import command and pipe it through withpv

In my tests, on a virtual machine with 2–4GB RAM, the ETA timer was pretty accurate for full mysql dumps with filesize of up to 3GB. If the file is larger, the timer can be off by a bit as slowdown happens.

Anyhow, the import was faster than using a typical mysql import.

Before proceeding, make sure you have pv installed on your linux box so we can monitor the progress.

Importing unzipped mysql dump with progress:

When the file starts importing, you’ll see a progress bar and ETA:

If your file is gzipped, we can pipe that too, no need to extract first:

Your file will be unzipped and imported on the fly.

I know, it’s not Mr. Robot level, but close enough.

That’s it.

On an unrelated note, are your Macbook Pro animations lagging? You should try switching to the dedicated (more powerful) graphic card when on power — automate it with this app https://gum.co/mac-auto-gpu

Founder binge.app. Curious dev. Laravel / Angular / VueJs / React Native / Docker. Love stand up shows.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store