[freetds] Problems with isql

Devinder Singh devinbhullar at gmail.com
Mon May 12 21:51:44 EDT 2008


thanks




2008/5/13 Igor <igorhmm at gmail.com>:

> You can add to $PATH or just create links... like
>
> cd /usr/bin
> ln -s /usr/local/freetds/bin/tsql
>
> regards
>
> On Mon, May 12, 2008 at 10:12 PM, Devinder Singh <devinbhullar at gmail.com>
> wrote:
> > Hi
> >
> >  I managed to run tsql
> >
> >  but i have to run it from
> >
> >  /usr/local/freetds/bin/ tsql - H
> >
> >  how can i run from #
> >
> >  do i need to do any export path in SUse?
> >
> >  Devinder
> >
> >  2008/5/11 Igor <igorhmm at gmail.com>:
> >
> >
> >
> >  > Hi,
> >  >
> >  > Try compiling FreeTDS with:
> >  >
> >  > ./configure --prefix=/usr/local/freetds --with-tdsver=8.0
> >  > --enable-msdblib --enable-dbmfix --with-gnu-ld
> --with-unixodbc=/usr/local
> >  >
> >  > create config files:
> >  >
> >  > --------------- odbc.ini ------------
> >  >
> >  > [root at bsd /usr/local/etc]# cat odbc.ini
> >  > [myServer]
> >  > Description = bla bla bla
> >  > Driver = FreeTDS
> >  > Server = 192.168.1.21
> >  > Port = 1401
> >  > TDS_version = 8.0
> >  > Database = youDatabaseNAme
> >  >
> >  >
> >  > --------------- odbcinst.ini ------------
> >  >
> >  > [FreeTDS]
> >  > Description     = FreeTDS ODBC Driver for MS-SQL
> >  > Driver          = /usr/local/lib/libtdsodbc.so
> >  > UsageCount      = 1
> >  >
> >  >
> >  > --------------- freetds.conf ------------
> >  >
> >  > [192.168.1.21]
> >  >        host = 192.168.1.21
> >  >        port = 1401
> >  >        tds version = 8.0
> >  >
> >  >
> >  > And try:
> >  >
> >  > # isql myServer user password
> >  >
> >  > Regards,
> >  >
> >  > Igor
> >  >
> >  >
> >  >
> >  > On Sun, May 11, 2008 at 1:03 AM, Devinder Singh <
> devinbhullar at gmail.com>
> >  > wrote:
> >  > > Hi Igor
> >  > >
> >  > >  I think im haveing the same problem TDS version 5.
> >  > >
> >  > >
> >  > >  Ok i read this from the php mssql site. Do i need to enable
> msdblib and
> >  > >  dbmfix the last time tried it could not find them.
> >  > >
> >  > >  INSTALLING FREETDS
> >  > >
> >  > >  1-.  Download freetds -> www.freetds.org
> >  > >  2-.  tar -zxvf freetds-stable-tgz
> >  > >  3-.  cd freetds-0.62.3
> >  > >  4-.  ./configure --prefix=/usr/local/freetds --with-tdsver=8.0
> >  > >  --enable-msdblib --enable-dbmfix --with-gnu-ld
> >  > >
> >  > >  Add the next text in freetds.conf ( /usr/local/freetds/etc )
> >  > >  [TDS]
> >  > >  host = <ip of the Server with Sql>
> >  > >  port = 1433
> >  > >  tds version = 8.0
> >  > >  I could not connect wven i added VErsion 8
> >  > >
> >  > >  When i Ran tsql -C
> >  > >
> >  > >  i still gert TDS version 5.
> >  > >
> >  > >  Pls help .
> >  > >
> >  > >  I sther a full detailed instrctions to set up Frree TDS and MSSQL
> 2000.
> >  > >
> >  > >  Thanks
> >  > >
> >  > >  Devinder
> >  > >
> >  > >
> >  > >
> >  > >
> >  > >  2008/5/10 Igor <igorhmm at gmail.com>:
> >  > >
> >  > >
> >  > >
> >  > > > Hi Igor :-)
> >  > >  >
> >  > >  > Sorry about this mistake... installing and deinstalling freetds
> >  > >  > version's I leave freeTDS running without unixODBC :-(
> >  > >  >
> >  > >  > I got freetds from cvs, make and install... configure with IP
> address
> >  > >  > and now is everything working fine!! ;-)
> >  > >  >
> >  > >  > Thanks all for the help and sorry about anything...
> >  > >  >
> >  > >  > Igor
> >  > >  >
> >  > >  > On Fri, May 9, 2008 at 8:10 PM, Igor Korot <ikorot at earthlink.net
> >
> >  > wrote:
> >  > >  > > Igor,
> >  > >  > >
> >  > >  > > -----Original Message-----
> >  > >  > >>From: Igor <igorhmm at gmail.com>
> >  > >  > >>Sent: May 9, 2008 6:46 PM
> >  > >  > >>To: FreeTDS Development Group <freetds at lists.ibiblio.org>
> >  > >  > >>Subject: Re: [freetds] Problems with isql
> >  > >  > >>
> >  > >  > >>Hi James,
> >  > >  > >>
> >  > >  > >>I'm trying with CVS version and now the IP address is accepted
> >  > fine..
> >  > >  > >>but doesn't connect :-(
> >  > >  > >>
> >  > >  > >>Check full log:
> >  > >  > >>
> >  > >  > >>[root at bsd ~/free/freetds/src/apps]# ./tsql -C
> >  > >  > >>Compile-time settings (established with the "configure"
> script)
> >  > >  > >>                            Version: freetds
> v0.83.dev.20080509
> >  > >  > >>             freetds.conf directory: /usr/local/etc
> >  > >  > >>     MS db-lib source compatibility: no
> >  > >  > >>        Sybase binary compatibility: no
> >  > >  > >>                      Thread safety: yes
> >  > >  > >>                      iconv library: no
> >  > >  > >>                        TDS version: 5.0
> >  > >  > >>                              iODBC: no
> >  > >  > >>                           unixodbc: no
> >  > >  > >>[root at bsd ~/free/freetds/src/apps]# ./tsql -S 192.168.1.21 -U
> >  > $DBUSER -P
> >  > >  > $DBPASS
> >  > >  > >>locale is "C"
> >  > >  > >>locale charset is "US-ASCII"
> >  > >  > >>1>
> >  > >  > >>[root at bsd ~/free/freetds/src/apps]# TDSDUMP=dump ./osql -S
> >  > LekkusLOJA
> >  > >  > >>-U $DBUSER -P $DBPASS
> >  > >  > >>looking for odbc.ini and odbcinst.ini in /usr/local/etc
> >  > >  > >>       reading "/root/.odbc.ini"
> >  > >  > >>[LekkusLOJA] not found in "/root/.odbc.ini"
> >  > >  > >>       reading "/usr/local/etc/odbc.ini"
> >  > >  > >>[LekkusLOJA] found in "/usr/local/etc/odbc.ini"
> >  > >  > >>found this section:
> >  > >  > >>       [LekkusLOJA]
> >  > >  > >>       Description = Lekkus LOJA
> >  > >  > >>       Driver = FreeTDS
> >  > >  > >>       Trace = No
> >  > >  > >>       Server = 192.168.1.21
> >  > >  > >>       Port = 1401
> >  > >  > >>       TDS_version = 8.0
> >  > >  > >>       Database = Lekkus
> >  > >  > >>
> >  > >  > >>looking for driver for DSN [LekkusLOJA]
> >  > >  > >>driver "FreeTDS" found for [LekkusLOJA] in odbc.ini
> >  > >  > >>found driver named "FreeTDS"
> >  > >  > >>FreeTDS is not a readable file
> >  > >  > >>looking for entry named [FreeTDS] in
> /usr/local/etc/odbcinst.ini
> >  > >  > >>driver "/usr/local/lib/libtdsodbc.so" found for [FreeTDS] in
> >  > odbcinst.ini
> >  > >  > >>/usr/local/lib/libtdsodbc.so is a readable file
> >  > >  > >>"Server" found, not using freetds.conf
> >  > >  > >>Server is "192.168.1.21"
> >  > >  > >>looking up hostname for ip address 192.168.1.21
> >  > >  > >>bzbraziline has address 192.168.1.21
> >  > >  > >>
> >  > >  > >>                           DSN:        LekkusLOJA
> >  > >  > >>                        Driver:
>  /usr/local/lib/libtdsodbc.so
> >  > >  > >>             Server's hostname:        bzbraziline
> >  > >  > >>                       Address:        192.168.1.21
> >  > >  > >>
> >  > >  > >>Attempting connection as lekkus ...
> >  > >  > >>+ exec isql LekkusLOJA lekkus *********** -v
> >  > >  > >>[S1000][unixODBC][FreeTDS][SQL Server]Unable to connect to
> data
> >  > source
> >  > >  > >>[ISQL]ERROR: Could not SQLConnect
> >  > >  > >>[root at bsd ~/free/freetds/src/apps]# cat dump
> >  > >  > >>util.c:292:Starting log file for FreeTDS 0.65.dev.20061107
> >  > >  > >>       on 2008-05-09 19:42:28 with debug flags 0x4fff.
> >  > >  > >>iconv.c:78:Using trivial iconv
> >  > >  > >>iconv.c:195:names for ISO-8859-1: ISO-8859-1
> >  > >  > >>iconv.c:195:names for UTF-8: UTF-8
> >  > >  > >>iconv.c:195:names for UCS-2LE: UCS-2LE
> >  > >  > >>iconv.c:195:names for UCS-2BE: (null)
> >  > >  > >>iconv.c:361:iconv to convert client-side data to the
> "ISO-8859-1"
> >  > >  > character set
> >  > >  > >>iconv.c:514:tds_iconv_info_init: converting
> "ISO-8859-1"->"UCS-2LE"
> >  > >  > >>login.c:226:IP address pointer is empty
> >  > >  > >>login.c:228:Server SYBASE not found!
> >  > >  > >                    ^^^^^^
> >  > >  > >
> >  > >  > > Apparently you are connecting to the Sybase server and not MS
> one.
> >  > >  > > How did you configure freeTDS?
> >  > >  > >
> >  > >  > >>mem.c:565:tds_free_all_results()
> >  > >  > >>odbc.c:3339:SQLFreeConnect(0x8060400)
> >  > >  > >>
> >  > >  > >>I really don't know what is happening...
> >  > >  > >>
> >  > >  > >>Thanks again !
> >  > >  > >>
> >  > >  > >>Igor
> >  > >  > >
> >  > >  > > Thank you.
> >  > >  > >
> >  > >  > > P.S.: Yes, it appears you're not the only Igor on earth... ;-)
> >  > >  > >
> >  > >  > >>
> >  > >  > >>On Fri, May 9, 2008 at 4:06 PM, James K. Lowden <
> >  > jklowden at freetds.org>
> >  > >  > wrote:
> >  > >  > >>> Igor wrote:
> >  > >  > >>>> I've installed bind to get /bin/host to work fine.. and now
> >  > FreeTDS is
> >  > >  > >>>> trying to connect to correct server:
> >  > >  > >>>
> >  > >  > >>> I just committed a new version of osql to CVS HEAD that
> handles
> >  > "server
> >  > >  > =
> >  > >  > >>> a.b.c.d" correctly.  :-)
> >  > >  > >>>
> >  > >  > >>>> [root at bsd ~]# osql -S LekkusLOJA -U $DBUSER -P $DBPASS
> >  > >  > >>> ...
> >  > >  > >>>>                            DSN:       LekkusLOJA
> >  > >  > >>>>              Server's hostname:       bzbraziline
> >  > >  > >>>>                        Address:       192.168.1.21
> >  > >  > >>>>                         Driver:
> >  > /usr/local/lib/libtdsodbc.so
> >  > >  > >>> [so far, so good]
> >  > >  > >>>> Attempting connection as lekkus...
> >  > >  > >>>> [S1000][unixODBC][FreeTDS][SQL Server]Unable to connect to
> data
> >  > source
> >  > >  > >>>> [ISQL]ERROR: Could not SQLConnect
> >  > >  > >>>
> >  > >  > >>> Omph!  OK, how about this:
> >  > >  > >>>
> >  > >  > >>>        $ TDSDUMP=dump osql -S LekkusLOJA -U $DBUSER -P
> $DBPASS
> >  > >  > >>>        $ head -20 dump
> >  > >  > >>>
> >  > >  > >>> It's in there somewhere.
> >  > >  > >>>
> >  > >  > >>> Did you mention the version of your server?   Your odbc.ini
> sets
> >  > >  > >>> TDS_Version = 8.0.  You need SQL Server 2000 for that.  Try
> e.g.
> >  > >  > >>>
> >  > >  > >>>        $ TDSVER=4.2 osql -S LekkusLOJA -U $DBUSER -P $DBPASS
> >  > >  > >>>
> >  > >  > >>> --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
> >  > >  >
> >  > >
> >  > >
> >  > >
> >  > >  --
> >  > >  Devinder
> >  > >
> >  > >
> >  > > _______________________________________________
> >  > >  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
> >  >
> >
> >
> >
> >  --
> >  Devinder
> >  _______________________________________________
> >  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
>



-- 
Devinder



More information about the FreeTDS mailing list