It looks like you're making a mistake when building the DSN: constrast yours ("DBI:mysql:$db;host=$host") and the one provided in the documentation of DBD::mysql:
use DBI; $dsn = "DBI:mysql:database=$database;host=$hostname;port=$port";
You're missing the "database=" before $db.
In reply to Re: Connecting to remote db with DBI
by ferreira
in thread Connecting to remote db with DBI
by dana
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |