Fix mysql persistent connection support in the deploy script (issue #3841)