Add mysql persistent connection support (issue #3713)