freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
Re: [freetds] issues connecting with perl DBD::ODBC
- From: "Kulik, Scott" <SKulik AT severstalna.com>
- To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
- Subject: Re: [freetds] issues connecting with perl DBD::ODBC
- Date: Tue, 23 Jun 2009 17:59:16 -0400
Wow...this is really frustrating. I thought this would be the easiest
step. I double checked the messages logs which didn't have any errors
and SELinux is already off.
I attempted to redo my configuration based on the config files below. I
can even setup an ODBC only config without using freetds.conf but I'm
still having the same issue. (even though I can connect and query using
isql no problem)
For some reason if I specify my $dbh like the following:
my $dbh = DBI->connect('dbi:ODBC:PTT', user', 'pass', {PrintError =>
0});
die "Unable for connect to server $DBI::errstr" unless $dbh;
the errstr is always blank. However, if I make a single change to
anything....DSN name, server name in config files or user/pass then I
get an error message.
If I try to use a format similar to:
my
$DSN="Driver=FreeTDS;Server=localhost;ServerName=TREX;Port=1799;Database
=TREX;UID=_user;PWD=_pass";
my $dbh = DBI->connect("dbi:ODBC:$DSN",'_user','_pass');
like mentioned in the last response I always get a segmentation fault.
Here is one of the combinations I tried:
my
$DSN="Driver=FreeTDS;Server=SPT-SQL02.DOMAIN.COM;Port=1433;Database=PTT;
UID=user;PWD=pass";
my $dbh = DBI->connect("dbi:ODBC:$DSN", 'user', 'pass', {PrintError =>
0});
I also setup a test SQL Server 2008 database and reran make test for
DBD::ODBC and everything looked great!
Here is the last odbc.ini config file I used without using freetds.conf:
[root@trafficdev1 root]# cat /etc/odbc.ini
[ODBC]
Trace = yes
TraceFile = /tmp/odbc.log
[PTT]
Driver = FreeTDS
Description = ODBC via FreeTDS
Trace = yes
TraceFile = /tmp/ptt.log
Server = SPT-SQL02.DOMAIN.COM
Trusted Connection = no
Port = 1433
Database = PTT
TDS_Version = 8.0
And the odbcinst.ini:
; Driver from freetds package
[FreeTDS]
Description = ODBC for SQL Server
Driver = /usr/local/lib/libtdsodbc.so
I have the latest freetds installed and the following ODBC rpm's
installed:
unixODBC-2.2.8-2.3.0.2
unixODBC-devel-2.2.8-2.3.0.2
perl v5.8.0 and the following DBI mods:
DBD::ODBC -- 1.22
DBD::Oracle -- 1.15
DBD::mysql -- 4.010
DBI -- 1.43
I'm up for anything else someone can think of!
Thanks for all the replies so far.
Scott k
-----Original Message-----
From: freetds-bounces AT lists.ibiblio.org
[mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of Michael Higgins
Sent: Tuesday, June 23, 2009 11:33 AM
To: freetds AT lists.ibiblio.org
Subject: Re: [freetds] issues connecting with perl DBD::ODBC
On Tue, 23 Jun 2009 11:03:10 -0400
"Kulik, Scott" <SKulik AT severstalna.com> wrote:
> Anyone have any luck getting connected to a SQL server database with
> DBD::ODBC in perl? I'm hoping to try to get this issue fixed this
> week but I'm out of ideas.
Ah, joy. Just re-joined the list. Glad to see things are much the same.
;-)
DBD::ODBC connection is totally possible and entirely opaque by
complexity.
Here are my configs for you to compare.
/etc/freetds.conf
# A typical Microsoft SQL Server 2000 configuration
[TREX]
host = localhost
# port =1799
tds version = 7.0
dump file = /home/mykhyggz/Desktop/freetds.log
/etc/unixODBC/odbc.ini
[ODBC Data Sources]
TREX = Microsoft SQL Server 2000
[ODBC]
Trace = yes
TraceFile = /home/mykhyggz/Desktop/odbc.log
[TREX]
Driver = /usr/lib/libtdsodbc.so
Description = TREX Data
Trace = Yes
TraceFile = /home/mykhyggz/Desktop/trex.log
Server = 127.0.0.1
Trusted Connection = no
Port = 1799
Database = TREX
TDS_Version = 7.0
[Default]
Driver = /usr/lib/libtdsodbc.so
/etc/unixODBC/odbcinst.ini
[Default]
Driver = /usr/lib/libtdsodbc.so
[FreeTDS]
Description = v0.63 with protocol v7.0
Driver = /usr/lib/libtdsodbc.so
;Setup = /usr/lib/libtdsS.so
;UsageCount = 2
And a working connect string:
my
$DSN="Driver=FreeTDS;Server=localhost;ServerName=TREX;Port=1799;Database
=TREX;UID=_user;PWD=_pass";
my $dbh = DBI->connect("dbi:ODBC:$DSN",'_user','_pass');
Probably there is something about having the Driver= line in there. Note
I have an SSH tunnel from my machine on port 1799 through another linux
box to the server.
HTH.
Cheers,
--
|\ /| | | ~ ~
| \/ | |---| `|` ?
| |ichael | |iggins \^ /
michael.higgins[at]evolone[dot]org
_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
-
[freetds] issues connecting with perl DBD::ODBC,
Kulik, Scott, 06/19/2009
-
Re: [freetds] issues connecting with perl DBD::ODBC,
Kulik, Scott, 06/23/2009
-
Re: [freetds] issues connecting with perl DBD::ODBC,
Michael Higgins, 06/23/2009
-
Re: [freetds] issues connecting with perl DBD::ODBC,
Kulik, Scott, 06/23/2009
-
Re: [freetds] issues connecting with perl DBD::ODBC,
Michael Higgins, 06/24/2009
- Re: [freetds] issues connecting with perl DBD::ODBC, Kulik, Scott, 06/24/2009
-
Re: [freetds] issues connecting with perl DBD::ODBC,
Per Stenebo, 06/24/2009
- Re: [freetds] issues connecting with perl DBD::ODBC, James K. Lowden, 06/29/2009
-
Re: [freetds] issues connecting with perl DBD::ODBC,
Michael Higgins, 06/24/2009
-
Re: [freetds] issues connecting with perl DBD::ODBC,
Kulik, Scott, 06/23/2009
- Re: [freetds] issues connecting with perl DBD::ODBC, Dan Wierenga, 06/23/2009
-
Re: [freetds] issues connecting with perl DBD::ODBC,
Michael Higgins, 06/23/2009
-
Re: [freetds] issues connecting with perl DBD::ODBC,
Kulik, Scott, 06/23/2009
Archive powered by MHonArc 2.6.24.