mysql databases state id conflict fix