Fix mysql cleanup code