Executing massive SQL query

I’m running MAMP on my MacBook and I need to execute a 10MB SQL query into a database (it’s the entire Bible) - but I guess the maximum execution time for a script is being hit every time.

What can I do to get this done aside from cutting and pasting hundreds of times?