Fix exception in mysql