Re: Not able to connect to Mysql Database using ODBC
- From: john1@xxxxxxxxxxxx
- Date: Fri, 01 Dec 2006 09:47:20 -0000
Apologies for the previous html.
On 30 Nov 2006 at 13:59, Also Sprach Narayana, Srimanrt License:
I am new to perl programming. Installed mysql,perl,mysql odbc
drivers
in my machine. Following is my code, its not working. I googled it but
no use :(
Why use odbc?
Get the latest activestate perl and using the package manager get the latest DBI and
DBD-mysql packages.
Here's some code that will connect to your mysql db (not tested):
#! /usr/bin/perl -w
use strict;
use diagnostics;
use DBI;
eval {
my $dbh = DBI-
connect('DBI:mysql:database=db_name;host=localhost;port=3306',
'username',
'password',
{'RaiseError' => 1,
'PrintError' => 0,
'AutoCommit' => 0} );
}; # eval
( $@ ) {
for my $dbh ( @dbhs ) {
$dbh->rollback if $dbh;
}
die $@;
}
.
- Prev by Date: Re: Not able to connect to Mysql Database using ODBC
- Next by Date: Can't test without successful make
- Previous by thread: Re: Not able to connect to Mysql Database using ODBC
- Next by thread: Can't test without successful make
- Index(es):
Relevant Pages
|