Fix 2.6 support for mysql module

The mysql module support for 2.6 is currently broken
b/c 2.6 does not support ananonymous hashes.

this commit refactors the code so that it should work with 2.6.