Improve MySQL logging Fix #243