If your script does not explicitly specify the connect DSN you can
use the
DBI_DSN envionment variable, otheriwse you are going to have to
modify
your script so that the host to connect to is configurable
(environment
varible/config file / &c..
Pls give me an example code. the configs could be:
MySQL server: 10.1.1.2 (hostname: mars)
database name: metric
port:3306 (default)
Script are on:10.1.1.1 (hostname:earth)
Below will be part of my scripts (no harm in changing these):
$dbh = DBI->connect($dsn, $user, $password)
Could you help me with defining my $dsn with above configs? I have not
set any username/password for my database (have installed it using
simple rpms)