Is there any way to show progress on a `gunzip < database.sql.gz | mysql ...` process?
You may use -v : Verbose mode (show progress) in your command, or there's another method using Pipe Viewer (pv
) which shows the progress of the gzip, gunzip command as follows:
$ pv database1.sql.gz | gunzip | mysql -u root -p database1
This will output progress similar to scp:
$ pv database1.sql.gz | gunzip | mysql -uroot -p database1
593MiB 1:00:33 [ 225kiB/s] [====================> ] 58% ETA 0:42:25
You can also use Pipe Viewer to monitor mysqldump:
mysqldump -uroot -p database1 | pv | gzip -9 > database1.sql.gz
If you don't already have pv
, you can install it with:
yum install pv
or with macports
sudo port install pv
or with homebrew
brew install pv
I think I would perform a drop database before loading up the data, and after it happened I could run a continuous "du -sh" in the databases directory. If I know the size the original database directory (Why wouldn't I?) then I can use it as a progress monitor. Are the db's are droppable?