CRITICAL connection management fixes for MySQL