mysql monitor and auto switch