We were experimenting with running an EE database stored on AWS and we found that MySQL was running on a non-standard port.
First thought was we'd add a config var for the MySQL port as per the CodeIngiter docs
$db['default']['port'] = 5432
but that didn't work instead we had to change the hostname to
$db['expressionengine']['hostname'] = "mysqldbinstance.hostname.com:4703";