I\'m using PDO to get data off a MySQL server. What I noticed is this: if the MySQL server is unavailable, it takes really (relatively) long for this code to return
I'm using the DBLIB driver for PDO - and that doesn't support the passing of options (throws a warning).
To get round this, you can edit the connection_timeout setting in the FreeTDS config file which is located at /etc/freetds/freetds.conf (on Ubuntu).
connection_timeout
/etc/freetds/freetds.conf