Showing progress bar while doing a MySql restore on your database

I have a few massive databases at work and every so often have to move them around for testing and or development or most recently migration. One of the biggest annoyances I’ve had with MySql for ever is the lack of any sort of progress bar. That is until I found the linux command pv. Now I can get a semi accurate idea of how long a restore is going to take and weather I should run the command in a ‘screen’ (tuxmux) or if it’s short enough that I can grab a coffee and come back when it’s finished. Anyhow here’s the command

pv BIGDATABASE_DUMP.sql | mysql -pYOUR_PASSWORD BIGDATABASE

The output will look something like this…

Note that the featured image on this post was AI generated and does not represent what the actual output looks like. Thus the screen shot above

Author: Miyar Es