简体   繁体   中英

How do i see the progess of mysql dump?

I use the following command to restore mysql dump.

mysql --defaults-file=/apps/mysql/instance/db01/my.cnf-UTIL < abc.sql

How will I be able to see the progress of the restore?

I do it like this:

pv -pert abc.sql | mysql --defaults-file=/apps/mysql/instance/db01/my.cnf-UTIL

pv is the Linux tool to "monitor the progress of data through a pipe."

The output with the -pert options looks like this:

0:00:29 [1.98MiB/s] [===>                                     ] 10% ETA 0:03:54

As the pv command reads through the file and passes it to mysql , the progress bar advances, the time updates, and so on. It's really handy.

Use the -v option to produce verbose output. It will show each query as it's being executed.

mysql -v --defaults-file=/apps/mysql/instance/db01/my.cnf-UTIL < abc.sql

You can also use -vv or -vvv to add increasing amounts of detail in the output, such as the number of rows affected and the amount of time taken by the query.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM