Skip to Content.
Sympa Menu

freetds - [freetds] Cannot get tsql to connect

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Chuck Roberts <croberts AT gilsongraphics.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] Cannot get tsql to connect
  • Date: Wed, 8 Jul 2015 12:17:58 -0400

I'm trying to test my ODBC with Freetds installation and I can't get tsql
to connect. My end result is to use DBD::ODBC with Perl 5.18.2. In the
meantime I'm trying to test with tsql per FreeTDS instructions.

- Machine: Ubuntu 14.04.1 LTS 64-bit, it's a virtual machine.
- Several ODBC packages installed on Ubuntu. /etc/odbc.ini points to
driver: /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
- Trying to connect to MS SQL Server 2005 (yes, we know it will be
unsupported soon). Username is \domain\username, no password.
- FreeTDS 0.91 (most recent I could find)
- Output of tsql -C:
chuck@ubuntucomp:~/perl/gilson/jimv/fedex$ tsql -C
Compile-time settings (established with the "configure" script)
Version: freetds v0.91
freetds.conf directory: /etc/freetds
MS db-lib source compatibility: no
Sybase binary compatibility: yes
Thread safety: yes
iconv library: yes
TDS version: 4.2
iODBC: no
unixodbc: yes
SSPI "trusted" logins: no
Kerberos: yes

- In my /etc/freetds/freetds.conf, bottom part I added for my connection:
[responsetds]
host = 10.20.30.40
port = 1433
tds version = 7.0
connect timeout = 20
timeout = 20
dump file = /tmp/freetds-resp.log

- tsql command and result. (IP, domain, user and password are fake)
chuck@ubuntucomp:~/perl/gilson/jimv/fedex$ tsql -S 10.20.30.40 -U
"DOMAIN\user" -P passwd
locale is "en_US.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
Msg 18452 (severity 14, state 1) from EDISON Line 1:
"Login failed for user ''. The user is not associated with a
trusted SQL Server connection."
Error 20002 (severity 9):
Adaptive Server connection failed
There was a problem connecting to the server

It looks like the user "DOMAIN\user" needs to be associated with a trusted
SQL server connection. I'm not the IT guy, so what do I tell my IT guy?
Other people on Windows are already using this domain\username to log in
without a password.

Also, specifying the command line with tsql means I bypassed the
freetds.conf, right?

Even though I'm using a domain logon, I don't have SSPI with FreeTDS. Do I
need SSPI? If so, how do I enable it?

I have already used Perl to connect to a Postgresql db but connecting to
MS SQL 2005 is brand new to me, please explain like I'm 5, I may have
missed a configuration step. I found instructions and it appears there are
several ways to configure this.

Thanks!




Archive powered by MHonArc 2.6.24.

Top of Page