Last Updated: February 25, 2016
·
4.371K
· bcandullo

Large Database Import Progress Using PV

PV can report progress for large data imports. In this example I will use a large (7 G) install on Ubuntu. First, download PV (http://linux.die.net/man/1/pv)

sudo apt-get install pv

A traditional mysql import may be formatted as:

mysql -u USER -p DATABASE_NAME < DUMP.mysql

but to leverage PV, pass the dump file ,then pipe the mysql command specifying the database with -D flag:

pv DUMP.mysql | mysql -u USER -p -D DATABASE_NAME

Your import will report progress and an ETA :)