(Backport) Added support for non-default MySQL host and port.

When I run tests over the MySQL RAM server, I'm usually running the MySQL RAM
server on a different port and I need this script in order to get that all
working in civicrm-project.