MySQL Bug Fixes

Using newer versions of MySQL had the potential to cause MySQL syntax
errors, those that could be found have been fixed so far.