add patch from matthew palmer to enhance mysql database selection (Closes: #452039)