Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
connecting to database remotely
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
gannu  
View profile  
 More options Mar 13, 9:07 am
From: gannu <bharath1...@gmail.com>
Date: Fri, 13 Mar 2009 06:07:15 -0700 (PDT)
Local: Fri, Mar 13 2009 9:07 am
Subject: connecting to database remotely
Hi All,

   I have installed DBI in xp box and I need to connect to mysql
available in linux box. any one know how to connect and fetch the
output of the query


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Axl Purushu  
View profile  
 More options Mar 12, 9:24 am
From: Axl Purushu <anup.puru...@katalystpartners.com>
Date: Thu, 12 Mar 2009 18:54:45 +0530
Local: Thurs, Mar 12 2009 9:24 am
Subject: Re: connecting to database remotely

use DBI;
$dsn= "dbi:DriverName:database=database_name;host=hostname;port=port";

# repalce hostname in the dsn with your linux server IP and port with
the mysql port number(default is 3306)

my $dbh = DBI->connect($dsn,'USERNAME','PASSWORD') or die "Connection
Error: $DBI::errstr\n";
my $sql = "your query goes here ....";
my $sth = $dbh->prepare($sql);
$sth->execute or die "SQL Error: $DBI::errstr\n";
while (my @row = $sth->fetchrow_array) {
       # Do something here ..

}

/anup


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google