Updated MySQL handling