batch-delete 12000 spam posts?

I try to delete spam users quickly, but one bot managed to create over 12000 blog posts before I caught it. I now get this error when trying to delete the user:

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 79 bytes) in [...]/public_html/elgg/engine/lib/metadata.php on line 44

Could somebody talk me through how to either increase the memory size for the function (I'm using shared hosting) OR delete the posts directly in the database (I have access through phpmyadmin)??

I really don't want all this gunk in my database! Thanks...