I don't know whether you're doing anything wrong w.r.t the connection timeout, but if you're relying on DNS, it might be a good idea to see how long that takes to timeout in the same situation.
-David
Comment on Re: How to set DBI connection timeout for Win32 Perl->MySQL ?