I have been trying to import a 60Gb sql file (mysql prompt reports 123Gb) to mysql. Its taking days for that import. I started with a simple import command.
Day1
mysql -u username -pPassword -h host db < db.sql
Day2
After a day to check status I ran
mysql> SELECT Data_BB / POWER(1024,1) Data_KB, Data_BB / POWER(1024,2) Data_MB, Data_BB / POWER(1024,3) Data_GB FROM (SELECT SUM(data_length) Data_BB FROM information_schema.tables WHERE table_schema NOT IN ('information_schema','performance_schema','mysql')) A;
+----------+--------------+--------------------+
| Data_KB | Data_MB | Data_GB |
+----------+--------------+--------------------+
| 120084976.196289062 | 120084.976196289062 | 120.084976196289062 |
+----------+--------------+--------------------+
Day3
I realized that I can also check `progress. On a separate prompt, I ran
ubuntu@ec2:~$ pv db.sql | sudo mysql -u username -pPassword -h host db
Day4
Today, when I checked,
The import terminal has broken connection
ubuntu@ec2:~$ pv db.sql | sudo mysql -u username -pPassword -h host db 10.5GB 14:38:43 [ 0B/s] [==========> ] 20% ETA 56:06:48
mysql> SELECT Data_BB / POWER(1024,1) Data_KB, Data_BB / POWER(1024,2) Data_MB, Data_BB / POWER(1024,3) Data_GB FROM (SELECT SUM(data_length) Data_BB FROM information_schema.tables WHERE table_schema NOT IN ('information_schema','performance_schema','mysql')) A;
+----------+--------------+--------------------+
| Data_KB | Data_MB | Data_GB |
+----------+--------------+--------------------+
| 26303504 | 25687.015625 | 25.084976196289062 |
+----------+--------------+--------------------+
Question
Why would the progress suddenly become 25Gb, from 120Gb.
コメント