mysql reconnection

I implement reconnection function for mysql back-end.