On 13 Feb 2002, at 20:21, Richard C Rossy wrote: > > My config script points to the same server for mysql. How do I get the > add.pl script to point to the server where mysql is. Config file: sub > configure { ######################################## # CGI > CONFIGURATION VARIABLES ######################################## > $mailprogram = "/usr/sbin/sendmail -t"; $mysqldatabase = "matchpro"; > $mysqlusername = "name"; $mysqlpassword = "pass"; Now each file .pl > has this line to get to the database: use DBI; $dbh = > DBI->connect("DBI:mysql:$mysqldatabase", "$mysqlusername", > "$mysqlpassword") || die("Couldn't connect to database!\n"); The > matchpro mysql is on an other server. Mysql doesn't run on the server > were the script is. How do I call the database?? Can use the help > richard >
Specifiy hostname and port of the machine matchpro is running on according to the DBD::mysql docs. However, for this the mysql client has to be installed on the machine the script is running on. If you can not manage this, use DBD::Proxy and DBI::ProxyServer. This requires that you can configure and start up DBI::ProxyServer on the machine running the database. HTH Bodo