It may not be of very much help, but using pv
and pipes in Linux, you can create a progress bar that will at least help you observe the quantity of data that has been loaded into the tables. It will also help you to assess the overall progress of the task.
As I am new on StackExchange, I need to pass a reputation score to use more StackOverflow. I request you to upvote, comment about improvements, or any other tips which can make this more helpful.
The command which worked for me is:
pv file-name.sql | mysql -u root -pPass <DataBaseName>
example:
pv steam_activity.sql | mysql -u root -pPass GAMEDATA
This will give a progress bar for SQL import which will look like this :
77.9GiB 9:20:33 [4.40MiB/s] [===========================================> ] 48% ETA 9:52:3
PLEASE NOTE THAT ALL THE METRICS ABOVE ARE CALCULATED WITH RESPECT TO DATA TRANSFERRED FROM SQL FILE TO MYSQL SERVER (i.e. from steam.sql to mysql process). THEREFORE THIS WON'T GIVE YOU PRECISE AMOUNT OF TIME LEFT FOR COMPLETION. BUT IT CAN PROVIDE A GOOD APPROXIMATION OF TIME REQUIRED.
It has nothing to do with the internal working of MySQL server engines so it won't be able to give a precise ETA for completion.
Let us discuss the output progress bar:
I am importing a 173 GB steam_activity.sql file into a newly created empty database named GAMEDATA.
Let us discuss the output progress bar:
77.9GiB 9:20:33 [4.40MiB/s] [===========================================> ] 48% ETA 9:52:3
77.9GiB: Amount of Data transferred from that 173 data file:
9:20:33 <Hours: Minutes: Seconds> : Time Elapsed since the process started
[4.40MiB/s] : Rate At which statements are read from steam_activity.sql
A progress bar: [===========================================> ]
48% : Amount of transfer completed:
ETA 9:52:30: Time required for completing the import. THIS IS NOT THE CORRECT N PRECISE TIME AS SOME INSERT STATEMENT MIGHT TAKE LONGER EXECUTION TiME THAN OTHER. Also, the table checks process can also happen, which can delay the importing.
Original post: How can I monitor the progress of an import of a large .sql file?
If you want tips on speedup, please comment or post other questions ( I loaded that 173 GB .SQL file in 17 hours ) or follow this post: MySQL any way to import a huge (32 GB) SQL dump faster? Estimation is 24 Days