Updated for new version of mysql