View Progress Of MySQL Dump Restore Or Import

Ever wondered why the MySQL command line tool don’t have any sort of progress information or status update? Well, you’re not alone if you do. Especially importing a GB sized dump file can take a long time, especially if the table engine was InnoDB.

There are some clever utilities which can be used to accomplish just that, by giving the user simple, yet useful information about the progress of their process. Let’s look at them.

Bar (Command Line Progress Bar)

The Bar utility, or in full terms Command Line Progress Bar can be downloaded from Sourceforge. If you are running Ubuntu, it’s as simple as running ‘sudo apt-get install bar’ to install it. You then simply pipe your MySQL import and get a nice status bar.

shell> bar -if=mysql_db_data.sql | mysql
Bar utility screenshot

Piper Viewer

To get a bit fancier, Piper Viewer can be inserted into any normal pipeline between two processes to give a visual indication of how quickly data is passing through, how long it has taken, how near to completion it is, and an estimate of how long it will be until completion. Observe multiple instances working in tandem,  a visual indicator of relative throughput in a complex pipeline. Download pv here.

pv -cN gzip mysql_db_data.sql.gz | gzip -d | pv -cN mysql | mysql
Piper Viewer

Either utility will undoubtedly shed more light into your restoration processes, and let you know whether the process is still running if in doubt and wondering after an hour or more.

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>