fixed some bugs and add support for mysql 5.5 and python 2.5

This is the version I used in our production environment. I fixed some bugs and also add support for mysql 5.5 and python 2.5.
Thank you for this great module.