This article describes how to use regexes and some bash tricks and bad voodoo to split a SQL file into pieces in order to get it into MySQL in a reasonable amount of time. Parsing SQL is notoriously painful and error prone, so if you see mistakes here (I'm sure there are), please comment!
I recently got called in to work on a project for a customer I had never worked with before. It is a very well known media / retail company and the job was to build a new interface for a media player / video library they required. Pretty standard stuff, some views a couple quicktabs, a bit of ajax coding and a lot of pixel-f**king. Anyway, near the end of the week long project when it came time to stage it, I realized I had a pretty big problem. This site had 2 million users and several tables of profile data and other information. My SQL file was over 3GB and took 6-8 hours to import. Eek!
So knowing that I wasn't going to write my update functions 100% perfect the first time, and I would likely have to import several times until I was confident it was working okay, I needed to find a way to get the DB to import in a more reasonable amount of time.