ERROR 1041 (HY000) OutOfMemory

I believe it makes sense to upgrade to latest stable 5.0 release, not to 5.1.