Change mysql requirements to work under 2.x
Various changes to make tests pass.