Refactor MySqlAdapter.