Progress bar: Dump and restore mysql database with progress bar.
Showing progress bar while dumping or restoration of the dump, would be a handy tool. Here is how you do it.
You can achieve with pipe viewer.
#apt-get install pv
An you may use the pv as shown in the image below to restore the database from a backup file..
# pv database.sql | mysql -u uname -p databasename
And to backup the database to a sql file with pv, use the following command.
#mysqldump -u username -p databasename | pv -W > database.sql
You can achieve with pipe viewer.
#apt-get install pv
An you may use the pv as shown in the image below to restore the database from a backup file..
# pv database.sql | mysql -u uname -p databasename
And to backup the database to a sql file with pv, use the following command.
#mysqldump -u username -p databasename | pv -W > database.sql
Compress the database file in gzipped version of the sql file
#mysqldump -u username -p databasename | pv -W | gzip > database.sql.gz
Restore the gzipped file
#pv database.sql.gz | gunzip | mysql -u root -p databasename
Restore the gzipped file
#pv database.sql.gz | gunzip | mysql -u root -p databasename
nice
ReplyDelete