Fix mysql support; improve logging