Fix mysql problems