Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

I happened to backed back up a MySQL database into one huge dump SQL file, which was 123G Bytes. When I tried to restore it to another computer, I found the restore process processing was very slow (especially the enable key step for a table). I decide to abandon some tables, but I found for such a large file, there is no good way to edit it. Even for tasks like delete just deleting the first line or last line is are very difficult. So I wrote a small python code to split the one huge dump file into small peacespieces.

The idea was simple. I just try to split the input file by the patterns like

...