Thanks It works now.
On Mon, 13 Dec 2004 23:43:06 -0800, Todd Lewis <[EMAIL PROTECTED]> wrote: > usually you have to log in as a local user before executing your > script. > > > > > I have written a simple program that should get data from a remote > > database, but it is not working giving error: > > DBI->connect(sugs:192.168.14.2) failed: Host 'www.sample.com' is not > > allowed to connect to this MySQL server at testbug.pl line 12 > > > > code is below: > > ***************** > > #! /usr/bin/perl -w > > > > use DBI; > > use strict; > > > > my ($driver = 'mysql',$user = 'root',$pass = "",$database = 'sugs'); > > > > my $dsn = "DBI:$driver:$dbname:192.168.14.2"; > > my $dbh = DBI->connect($dsn,$user,$pass); > > > > my $strsql="select * from products where product='L2'"; > > my $sth = ($dbh->prepare($strsql) || die "Query could not be executed > > " . $dbh->errstr()); > > i$sth->execute(); > > while (my $row = $sth->fetchrow_arrayref){ > > print join("\t", @$row), "\n"; > > } > > $sth->finish(); > > $dbh->disconnect(); > > > > Script is working fine on the host machine(192.168.14.2) but give > > error when run from remote machine... > > any suggestion? > > > > Thanks > > Adam > > > > -- > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > <http://learn.perl.org/> <http://learn.perl.org/first-response> > > > > > > -- Allah Hafiz O! God Thy sea is so great and my boat is so small. Adam -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>