Skip to Content.
Sympa Menu

freetds - Re: [freetds] what am I missing?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Chris Bartram <chrisrbartram AT yahoo.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] what am I missing?
  • Date: Tue, 24 May 2011 19:18:10 -0700 (PDT)


I don't have one... at least I never created one; only the main one in
/usr/local/etc.

-Chris

"The purpose of life is not to be happy. It is to be useful, to be
honorable,
to be compassionate, to have it make some difference that you have lived and
lived well". (Ralph Waldo Emerson)




________________________________
From: Andrew H. Wakefield <a_wake AT earthlink.net>
To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
Sent: Tue, May 24, 2011 8:09:38 PM
Subject: Re: [freetds] what am I missing?

Chris,

You are showing the freetds.conf file in /usr/local/etc -- but the first
place freetds will look, I think, is in your home folder. What is in
the .freetds.conf file there?

On Tue, 2011-05-24 at 15:43 -0700, Chris Bartram wrote:
>
> Many thanks for the logging/debug tips. With that I was able to figure out
> (I
> think) what's happening:
>
>
> When connecting via dsn name it appears it’s reaching the correct server
> and
> using the correct TCP port – but using TDS version 5 instead of the version
> 8
>as
>
> defined in the freetds.conf file… ???
>
> Perl code I’m using to connect:
>
> $dbh = DBI->connect("dbi:ODBC:SQLServer",$username,$userpass);
>
> In this attempt was passing NT domain authentication credentials for
> username
> and password. Got similar results when I also tried with a local SQL
> user/pass.
>
>
>
>
>
>
> -bash-3.2$ cat /tmp/freetds.log
> log.c:190:Starting log file for FreeTDS 0.82
> on 2011-05-24 13:43:42 with debug flags 0x4fff.
> iconv.c:197:names for ISO-8859-1: ISO-8859-1
> iconv.c:197:names for UTF-8: UTF-8
> iconv.c:197:names for UCS-2LE: UCS-2LE
> iconv.c:197:names for UCS-2BE: UCS-2BE
> iconv.c:363:iconv to convert client-side data to the "ISO-8859-1" character
set
> iconv.c:516:tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE"
> net.c:210:Connecting to xxx.xxx.xxx.xxx port 1433 (TDS version 5.0)
> net.c:264:tds_open_socket: connect(2) returned "Operation now in progress"
> net.c:303:tds_open_socket() succeeded
> util.c:162:Changed query state from DEAD to IDLE
> login.c:537:NT login not support using TDS 4.x or 5.0
> util.c:162:Changed query state from IDLE to DEAD
> util.c:334:tdserror(0x6876720, 0x6879140, 20002, 0)
> odbc.c:2032:msgno 20002 20003
> util.c:368:tdserror: client library returned TDS_INT_CANCEL(2)
> util.c:389:tdserror: returning TDS_INT_CANCEL(2)
> mem.c:563:tds_free_all_results()
> error.c:574:SQLError((nil), 0x6877b90, (nil), 0x7fff934bd5e0,
> 0x7fff934bd5f4,
> 0x7fff934bd0c0, 513, 0x7fff934bd5fe)
> error.c:510:_SQLGetDiagRec(2, 0x6877b90, 1, 0x7fff934bd5e0, 0x7fff934bd5f4,
> 0x7fff934bd0c0, 513, 0x7fff934bd5fe)
> error.c:574:SQLError((nil), 0x6877b90, (nil), 0x7fff934bd5e0,
> 0x7fff934bd5f4,
> 0x7fff934bd0c0, 513, 0x7fff934bd5fe)
> error.c:510:_SQLGetDiagRec(2, 0x6877b90, 1, 0x7fff934bd5e0, 0x7fff934bd5f4,
> 0x7fff934bd0c0, 513, 0x7fff934bd5fe)
> error.c:574:SQLError((nil), 0x6877b90, (nil), 0x7fff934bd5e0,
> 0x7fff934bd5f4,
> 0x7fff934bd0c0, 513, 0x7fff934bd5fe)
> error.c:510:_SQLGetDiagRec(2, 0x6877b90, 1, 0x7fff934bd5e0, 0x7fff934bd5f4,
> 0x7fff934bd0c0, 513, 0x7fff934bd5fe)
> odbc.c:3680:SQLFreeHandle(2, 0x0x6877b90)
> odbc.c:3706:_SQLFreeConnect(0x6877b90)
> odbc.c:3680:SQLFreeHandle(1, 0x0x68766c0)
> odbc.c:3744:_SQLFreeEnv(0x68766c0)
>
>
> -bash-3.2$ cat /usr/local/etc/freetds.conf
>
> # $Id: freetds.conf,v 1.12 2007/12/25 06:02:36 jklowden Exp $
> #
> # This file is installed by FreeTDS if no file by the same
> # name is found in the installation directory.
> #
> # For information about the layout of this file and its settings,
> # see the freetds.conf manpage "man freetds.conf".
>
> # Global settings are overridden by those in a database
> # server specific section
> [global]
> # TDS protocol version
> ; tds version = 4.2
>
> # Whether to write a TDSDUMP file for diagnostic purposes
> # (setting this to /tmp is insecure on a multi-user system)
> dump file = /tmp/freetds.log
> debug flags = 0xffff
>
> # Command and connection timeouts
> ; timeout = 10
> ; connect timeout = 10
>
> # If you get out-of-memory errors, it may mean that your client
> # is trying to allocate a huge buffer for a TEXT field.
> # Try setting 'text size' to a more reasonable limit
> text size = 64512
>
> # A typical Sybase server
> [egServer50]
> host = symachine.domain.com
> port = 5000
> tds version = 5.0
>
> # A typical Microsoft server
> [egServer70]
> host = ntmachine.domain.com
> port = 1433
> tds version = 7.0
>
> [SQLServer]
> host = scomsqlclus.domain.org
> port = 1433
> tds version = 8.0
>
>
>
> -bash-3.2$ cat .odbc.ini
> [SQLServer]
> Driver=FreeTDS
> Description=SCOM Database
> Trace=No
> TraceFile=/tmp/odbc.trace
> Server=SCOMSQLCLUS.domain.org
> Port=1433
> Database=OperationsManager
> "The purpose of life is not to be happy. It is to be useful, to be
> honorable,

> to be compassionate, to have it make some difference that you have lived
> and
> lived well". (Ralph Waldo Emerson)
>
>
>
>
> ________________________________
> From: Chris Bartram <chrisrbartram AT yahoo.com>
> To: konrad AT payplus.com; FreeTDS Development Group
> <freetds AT lists.ibiblio.org>
> Sent: Tue, May 24, 2011 7:42:46 AM
> Subject: Re: [freetds] what am I missing?
>
>
> The destination host in my case is Microsoft SQL (2005 cluster); but I did
> try

> with both a dbi:ODBC:nameinfreetds.conf; as well as the
> dbi:ODBC:DRIVER={freetds};server=sqlservclus.domain.org (also tried IP
> address
>
> instead of the hostname). Same errors...
>
> Using the tsql program though I can make a connection and retrieve data
> from
>the
>
>
> database just fine??
>
> -Chris
>
> "The purpose of life is not to be happy. It is to be useful, to be
> honorable,
> to be compassionate, to have it make some difference that you have lived
> and
> lived well". (Ralph Waldo Emerson)
>
>
>
>
> ________________________________
> From: Konrad J Hambrick <konrad AT payplus.com>
> To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
> Sent: Tue, May 24, 2011 5:33:58 AM
> Subject: Re: [freetds] what am I missing?
>
>
> Chris --
>
> I believe Randy nailed it. Your DBI->connect() string must include
> the $TDSHOST ( the Name in Brackets in /usr/local/etc/freetds.conf ).
>
> Like so:
>
> If your freetds.conf contains a server config:
>
> [Win2k3]
> host = win2k3.kjh.lan
> port = 1433
> tds version = 8.0
>
> then your DBI->connect() string should be (note the server= in the connect
> string):
>
> my $dbh = = DBI->connect( "DBI:Sybase:maxConnect=100:server=Win2k3",
> $TDSUser,
> $TDSPass,
> { PrintError
> =>
>0,
>
>
> # Option #1
> AutoCommit
> =>
>1,
>
>
> # Option #2, etc
> } ) ;
>
> HTH
>
> -- kjh
>
> Randy Syring wrote, On 05/23/2011 11:10 PM:
> > Try TDSDUMPCONFIG to see all the connection params that TDS is using.
> >
> > http://www.freetds.org/userguide/logging.htm
> >
> > I don't see a server name or IP address, might that be the issue?
> >
> > --------------------------------------
> > Randy Syring
> > Intelicom
> > Direct: 502-276-0459
> > Office: 502-212-9913
> >
> > For the wages of sin is death, but the
> > free gift of God is eternal life in
> > Christ Jesus our Lord (Rom 6:23)
> >
> >
> > On 05/23/2011 11:51 PM, Chris Bartram wrote:
> >> Thanks! Took care of the Perl .so loading issues...
> >>
> >> /usr/local/bin/tsql connection now working; I can connect and query data
>that
> >> way.
> >>
> >> Perl dbi:ODBC fails with following error codes:
> >>
> >> DBI connect('SQLServer','user',...) failed: [unixODBC][FreeTDS][SQL
> >> Server]Unable to connect to data source (SQL-08001) [state was 08001 now
> >01000]
> >> [unixODBC][FreeTDS][SQL Server]Adaptive Server connection failed
(SQL-01000)
> >> [unixODBC][FreeTDS][SQL Server]Unexpected EOF from the server
> >> (SQL-01000)
at
> >> ./testscom.pl line 9
> >>
> >> Source looks like this:
> >>
> >> $dbh = DBI->connect("dbi:ODBC:SQLServer","user",$userpass);
> >>
> >> (also tried the DRIVER={};Server= format; same errors.)
> >>
> >> Target server is a SQL 2005 cluster; default instance – not a named
> >> instance.Calling from perl on a RHEL system.
> >>
> >>
> >> Any suggestions?
> >>
> >> -Chris Bartram
> >> "The purpose of life is not to be happy. It is to be useful, to be
> >>honorable,
> >> to be compassionate, to have it make some difference that you have lived
and
> >> lived well". (Ralph Waldo Emerson)
> >>
> >>
> >>
> >>
> >> ________________________________
> >> From: James K. Lowden<jklowden AT freetds.org>
> >> To: freetds AT lists.ibiblio.org
> >> Sent: Wed, May 18, 2011 11:04:43 PM
> >> Subject: Re: [freetds] what am I missing?
> >>
> >> On Tue, 17 May 2011 19:30:17 -0700 (PDT)
> >> Chris Bartram<chrisrbartram AT yahoo.com> wrote:
> >>
> >>> When I try the ODBC connection in a Perl program I get
> >>> errors that the .so is not found; yet an ls shows the file(s) right
> >>> where it's supposed to be looking. tsql looks like it might be
> >>> working?
> >> http://www.freetds.org/91/userguide/linker.how.htm
> >>
> >> If Perl says it can't find the .so, it's telling the truth. Because
> >> Perl::DBI is using dlopen(3), nothing in the Perl executable nor the
> >> DBI library affects where the runtime linker looks. You have to tell
> >> it. LD_LIBRARY_PATH is your friend, but you may have to resort to
> >> LD_PRELOAD.
> >>
> >> HTH.
> >>
> >> --jkl
> >> _______________________________________________
> >> FreeTDS mailing list
> >> FreeTDS AT lists.ibiblio.org
> >> http://lists.ibiblio.org/mailman/listinfo/freetds
> >> _______________________________________________
> >> FreeTDS mailing list
> >> FreeTDS AT lists.ibiblio.org
> >> http://lists.ibiblio.org/mailman/listinfo/freetds
> > _______________________________________________
> > FreeTDS mailing list
> > FreeTDS AT lists.ibiblio.org
> > http://lists.ibiblio.org/mailman/listinfo/freetds
>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds


_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds

>From jklowden AT freetds.org Tue May 24 22:53:55 2011
Return-Path: <jklowden AT freetds.org>
X-Original-To: freetds AT lists.ibiblio.org
Delivered-To: freetds AT lists.ibiblio.org
Received: by lists.ibiblio.org (Postfix, from userid 20217)
id 8217FE8B86; Tue, 24 May 2011 22:53:55 -0400 (EDT)
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on
mailman1.ibiblio.org
X-Spam-Level:
X-Spam-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,RDNS_DYNAMIC
autolearn=no version=3.2.5
Received: from oak.schemamania.org (dsl254-083-208.nyc1.dsl.speakeasy.net
[216.254.83.208])
by lists.ibiblio.org (Postfix) with ESMTP id 42971E8B4D
for <freetds AT lists.ibiblio.org>; Tue, 24 May 2011 22:53:55 -0400 (EDT)
Received: from oak.schemamania.org (localhost [IPv6:::1])
by oak.schemamania.org (Postfix) with SMTP id 7626030E2088
for <freetds AT lists.ibiblio.org>; Tue, 24 May 2011 22:53:54 -0400 (EDT)
Date: Tue, 24 May 2011 22:53:54 -0400
From: "James K. Lowden" <jklowden AT freetds.org>
To: freetds AT lists.ibiblio.org
Message-Id: <20110524225354.51dda503.jklowden AT freetds.org>
In-Reply-To: <1306282178.1807.2.camel@linux-laptop>
References: <461427.10452.qm AT web126006.mail.ne1.yahoo.com>
<20110518230443.6a25577e.jklowden AT freetds.org>
<692515.29129.qm AT web126012.mail.ne1.yahoo.com>
<4DDB2FAC.9040207 AT inteli-com.com> <4DDB7B86.50405 AT payplus.com>
<503414.57479.qm AT web126004.mail.ne1.yahoo.com>
<938073.55677.qm AT web126003.mail.ne1.yahoo.com>
<1306282178.1807.2.camel@linux-laptop>
X-Mailer: Sylpheed 3.0.2 (GTK+ 2.20.1; x86_64--netbsd)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Subject: Re: [freetds] what am I missing?
X-BeenThere: freetds AT lists.ibiblio.org
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
List-Id: FreeTDS Development Group <freetds.lists.ibiblio.org>
List-Unsubscribe: <http://lists.ibiblio.org/mailman/listinfo/freetds>,
<mailto:freetds-request AT lists.ibiblio.org?subject=unsubscribe>
List-Archive: <https://lists.ibiblio.org/sympa/arc/freetds>
List-Post: <mailto:freetds AT lists.ibiblio.org>
List-Help: <mailto:sympa AT lists.ibiblio.org?subject=HELP>
List-Subscribe: <http://lists.ibiblio.org/mailman/listinfo/freetds>,
<mailto:freetds-request AT lists.ibiblio.org?subject=subscribe>
X-List-Received-Date: Wed, 25 May 2011 02:53:55 -0000

On Tue, 24 May 2011 20:09:38 -0400
"Andrew H. Wakefield" <a_wake AT earthlink.net> wrote:

> You are showing the freetds.conf file in /usr/local/etc -- but the
> first place freetds will look, I think, is in your home folder.

tsql -C shows the location for freetds.conf.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page