Show status of MySQL imports using PipeViewer

08 / Apr / 2014 by Nikhil Bhandari 0 comments

While working on my current application, I had to import a large database using mysql from a sql dump. The size of the sql dump was around 1.5 GB and hence the import was taking long time. I just felt the need of some tool that could help me check the progress of the import.

The command I used was:

[sql]
mysql –user=username –password=password database_name < dump.sql
[/sql]

So I searched and thankfully, found an ubuntu package, PipeViewer(pv) which shows a neat progress-bar with useful information such as time elapsed, percentage completed (with progress bar), current throughput rate, total data transferred, and ETA.

To install simply type:

[shell]
sudo apt-get install pv
[/shell]

Example usage:

[shell]
pv dump.sql | mysql –user=username –password=password databse_name
[/shell]

I hope you’ll find this post usefull.

Nikhil Bhandari
IntelliGrape Software Pvt. Ltd.
nikhil.bhandari@intelligrape.com

Source: Author’s Site – Man Page

FOUND THIS USEFUL? SHARE IT

Leave a Reply

Your email address will not be published. Required fields are marked *