The problem does not lie with Heroku, I've been able to successfully connect to external databases with my hosting provider in the past. You need to use this notation:
$pdoconn = new PDO('mysql:host=' . $host . ';dbname=' . $db, $user, $pwd, array( PDO::ATTR_PERSISTENT => false));
Media temple on the other hand have a policy of only allowing specific IP addresses to connect to the mysql instance runninng in your Grid Server from an external location.
You can alter that list by following these steps:
Your Domain > Admin > Manage Databases > Users & Settings > External Databases > Add IP
The problem here relies mainly on determining your Heroku server's IP address exposed to MediaTemple, as address will change over time.
To determine your exposed IP you can create a new file ipcheck.php
with contents as follows:
<?php
$homepage = file_get_contents('http://www.whatsmyip.org/');
echo $homepage;
?>
Then browse this page after deploying to your heroku instance, you will see that your IP is pretty much different with every request.
The only way around this is by provisioning a static IP through the Proximo addon or similar, then configuring MediaTemple to allow external connections from that IP.
Its probably cheaper to run a hostgator server for your mysql database (hostgator mysql database allows external connections from anywhere).