Skip to Content.
Sympa Menu

freetds - [freetds] Problem connecting to database

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Peter Ross" <peter AT emailross.com>
  • To: FreeTDS AT lists.ibiblio.org
  • Subject: [freetds] Problem connecting to database
  • Date: Tue, 28 Oct 2008 13:15:22 +1100

I'm trying to attach to a sql server 2000 database using freetds (v
0.63 packaged for ubuntu 8.04).

I can connect using the user 'sa' but I cannot connect using the user
'MCTests' which I have defined myself.
I can connect using 'MCTests' using ODBC from Windows Vista.

Here is my .odbc.ini
[oligood]
Driver = /usr/lib/odbc/libtdsodbc.so
Description = TDS driver (Sybase/MS SQL)
Address = 10.10.10.200
Port = 1433
TDS_Version = 7.0

I'm guessing it is actually a problem with the SQL server 2000
configuration but I have got no ideas where to look.

See below for the traces of a successful and then unsuccessful login.

Thanks for help in advance,
Peter

Here is a dump of my successful login using sa

$ TDSDUMP=stdout isql oligood sa password
13:09:40.177033 Starting log file for FreeTDS 0.63
on 2008-10-28 13:09:40 with debug level 99.
13:09:40.177077 names for ISO-8859-1: ISO-8859-1
13:09:40.177087 names for UTF-8: UTF-8
13:09:40.177094 names for UCS-2LE: UCS-2LE
13:09:40.177100 names for UCS-2BE: UCS-2BE
13:09:40.177112 iconv to convert client-side data to the "UTF-8" character set
13:09:40.177128 tds_iconv_info_init: converting "UTF-8"->"UCS-2LE"
13:09:40.177146 tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE"
13:09:40.177161 Connecting to 10.10.10.200 port 1433, TDS 7.0.
13:09:40.622861 tds_put_string converting 6 bytes of "fermat"
13:09:40.622964 tds_put_string wrote 12 bytes
13:09:40.622994 tds_put_string converting 2 bytes of "sa"
13:09:40.623015 tds_put_string wrote 4 bytes
13:09:40.623058 tds_put_string wrote 0 bytes
13:09:40.623079 tds_put_string converting 6 bytes of "SYBASE"
13:09:40.623099 tds_put_string wrote 12 bytes
13:09:40.623116 tds_put_string wrote 0 bytes
13:09:40.623133 tds_put_string converting 10 bytes of "us_english"
13:09:40.623276 tds_put_string wrote 20 bytes
13:09:40.623298 tds_put_string wrote 0 bytes
13:09:40.623369 tds_process_login_tokens()
13:09:41.177974 Received header
0000 04 01 01 b0 00 33 01 00- |.....3..|

13:09:41.178095 Received packet
0000 e3 1b 00 01 06 6d 00 61-00 73 00 74 00 65 00 72 |.....m.a .s.t.e.r|
0010 00 06 6d 00 61 00 73 00-74 00 65 00 72 00 ab 6e |..m.a.s. t.e.r..n|
0020 00 45 16 00 00 02 00 25-00 43 00 68 00 61 00 6e |.E.....% .C.h.a.n|
0030 00 67 00 65 00 64 00 20-00 64 00 61 00 74 00 61 |.g.e.d. .d.a.t.a|
0040 00 62 00 61 00 73 00 65-00 20 00 63 00 6f 00 6e |.b.a.s.e . .c.o.n|
0050 00 74 00 65 00 78 00 74-00 20 00 74 00 6f 00 20 |.t.e.x.t . .t.o. |
0060 00 27 00 6d 00 61 00 73-00 74 00 65 00 72 00 27 |.'.m.a.s .t.e.r.'|
0070 00 2e 00 0c 56 00 44 00-49 00 57 00 2d 00 44 00 |....V.D. I.W.-.D.|
0080 42 00 54 00 45 00 53 00-54 00 31 00 00 01 00 e3 |B.T.E.S. T.1.....|
0090 17 00 02 0a 75 00 73 00-5f 00 65 00 6e 00 67 00 |....u.s. _.e.n.g.|
00a0 6c 00 69 00 73 00 68 00-00 ab 72 00 47 16 00 00 |l.i.s.h. ..r.G...|
00b0 01 00 27 00 43 00 68 00-61 00 6e 00 67 00 65 00 |..'.C.h. a.n.g.e.|
00c0 64 00 20 00 6c 00 61 00-6e 00 67 00 75 00 61 00 |d. .l.a. n.g.u.a.|
00d0 67 00 65 00 20 00 73 00-65 00 74 00 74 00 69 00 |g.e. .s. e.t.t.i.|
00e0 6e 00 67 00 20 00 74 00-6f 00 20 00 75 00 73 00 |n.g. .t. o. .u.s.|
00f0 5f 00 65 00 6e 00 67 00-6c 00 69 00 73 00 68 00 |_.e.n.g. l.i.s.h.|
0100 2e 00 0c 56 00 44 00 49-00 57 00 2d 00 44 00 42 |...V.D.I .W.-.D.B|
0110 00 54 00 45 00 53 00 54-00 31 00 00 01 00 e3 0f |.T.E.S.T .1......|
0120 00 03 05 69 00 73 00 6f-00 5f 00 31 00 01 00 00 |...i.s.o ._.1....|
0130 e3 0b 00 05 04 31 00 30-00 33 00 33 00 00 e3 0f |.....1.0 .3.3....|
0140 00 06 06 31 00 39 00 36-00 36 00 30 00 39 00 00 |...1.9.6 .6.0.9..|
0150 ad 36 00 01 07 00 00 00-16 4d 00 69 00 63 00 72 |.6...... .M.i.c.r|
0160 00 6f 00 73 00 6f 00 66-00 74 00 20 00 53 00 51 |.o.s.o.f .t. .S.Q|
0170 00 4c 00 20 00 53 00 65-00 72 00 76 00 65 00 72 |.L. .S.e .r.v.e.r|
0180 00 00 00 00 00 09 00 0b-e2 e3 13 00 04 04 34 00 |........ ......4.|
0190 30 00 39 00 36 00 04 34-00 30 00 39 00 36 00 fd |0.9.6..4 .0.9.6..|
01a0 00 00 00 00 00 00 00 00- |........|

13:09:41.178597 looking for login token, got e3(ENVCHANGE)
13:09:41.178631 tds_process_default_tokens() marker is e3(ENVCHANGE)
13:09:41.178668 tds_get_string: reading 12 from wire to give 6 to client.
13:09:41.178710 tds_get_string: reading 12 from wire to give 6 to client.
13:09:41.178743 looking for login token, got ab(INFO)
13:09:41.178763 tds_process_default_tokens() marker is ab(INFO)
13:09:41.178782 tds_get_string: reading 74 from wire to give 37 to client.
13:09:41.178805 tds_get_string: reading 24 from wire to give 12 to client.
13:09:41.178844 looking for login token, got e3(ENVCHANGE)
13:09:41.178866 tds_process_default_tokens() marker is e3(ENVCHANGE)
13:09:41.178898 tds_get_string: reading 20 from wire to give 10 to client.
13:09:41.178924 looking for login token, got ab(INFO)
13:09:41.178943 tds_process_default_tokens() marker is ab(INFO)
13:09:41.178960 tds_get_string: reading 78 from wire to give 39 to client.
13:09:41.178986 tds_get_string: reading 24 from wire to give 12 to client.
13:09:41.179017 looking for login token, got e3(ENVCHANGE)
13:09:41.179052 tds_process_default_tokens() marker is e3(ENVCHANGE)
13:09:41.179072 tds_get_string: reading 10 from wire to give 5 to client.
13:09:41.179095 tds_get_string: reading 2 from wire to give 1 to client.
13:09:41.179193 tds_iconv_info_init: converting "UTF-8"->"ISO-8859-1"
13:09:41.179235 looking for login token, got e3(ENVCHANGE)
13:09:41.179255 tds_process_default_tokens() marker is e3(ENVCHANGE)
13:09:41.179274 tds_get_string: reading 8 from wire to give 4 to client.
13:09:41.179294 looking for login token, got e3(ENVCHANGE)
13:09:41.179313 tds_process_default_tokens() marker is e3(ENVCHANGE)
13:09:41.179330 tds_get_string: reading 12 from wire to give 6 to client.
13:09:41.179360 looking for login token, got ad(LOGINACK)
13:09:41.179381 tds_get_string: reading 44 from wire to give 22 to client.
13:09:41.179401 looking for login token, got e3(ENVCHANGE)
13:09:41.179420 tds_process_default_tokens() marker is e3(ENVCHANGE)
13:09:41.179450 tds_get_string: reading 8 from wire to give 4 to client.
13:09:41.179471 tds_get_string: reading 8 from wire to give 4 to client.
13:09:41.179491 increasing block size from 4096 to 4096
13:09:41.179513 looking for login token, got fd(DONE)
13:09:41.179530 tds_process_default_tokens() marker is fd(DONE)
13:09:41.179546 tds_process_end: more_results = 0
was_cancelled = 0
error = 0
done_count_valid = 0
13:09:41.179579 tds_process_end() state set to TDS_IDLE

Here is the failing login using MCTests

$ TDSDUMP=stdout isql oligood MCTests password
13:12:28.194394 Starting log file for FreeTDS 0.63
on 2008-10-28 13:12:28 with debug level 99.
13:12:28.194512 names for ISO-8859-1: ISO-8859-1
13:12:28.194535 names for UTF-8: UTF-8
13:12:28.194597 names for UCS-2LE: UCS-2LE
13:12:28.194629 names for UCS-2BE: UCS-2BE
13:12:28.194649 iconv to convert client-side data to the "UTF-8" character set
13:12:28.194695 tds_iconv_info_init: converting "UTF-8"->"UCS-2LE"
13:12:28.194746 tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE"
13:12:28.194786 Connecting to 10.10.10.200 port 1433, TDS 7.0.
13:12:28.654370 tds_put_string converting 6 bytes of "fermat"
13:12:28.654459 tds_put_string wrote 12 bytes
13:12:28.654481 tds_put_string converting 7 bytes of "MCTests"
13:12:28.654518 tds_put_string wrote 14 bytes
13:12:28.654539 tds_put_string wrote 0 bytes
13:12:28.654555 tds_put_string converting 6 bytes of "SYBASE"
13:12:28.654629 tds_put_string wrote 12 bytes
13:12:28.654649 tds_put_string wrote 0 bytes
13:12:28.654665 tds_put_string converting 10 bytes of "us_english"
13:12:28.654682 tds_put_string wrote 20 bytes
13:12:28.654702 tds_put_string wrote 0 bytes
13:12:28.654754 tds_process_login_tokens()
13:12:29.070755 Received header
0000 04 01 00 78 00 33 01 00- |...x.3..|

13:12:29.070827 Received packet
0000 aa 64 00 18 48 00 00 01-0e 20 00 4c 00 6f 00 67 |.d..H... . .L.o.g|
0010 00 69 00 6e 00 20 00 66-00 61 00 69 00 6c 00 65 |.i.n. .f .a.i.l.e|
0020 00 64 00 20 00 66 00 6f-00 72 00 20 00 75 00 73 |.d. .f.o .r. .u.s|
0030 00 65 00 72 00 20 00 27-00 4d 00 43 00 54 00 65 |.e.r. .' .M.C.T.e|
0040 00 73 00 74 00 73 00 27-00 2e 00 0c 56 00 44 00 |.s.t.s.' ....V.D.|
0050 49 00 57 00 2d 00 44 00-42 00 54 00 45 00 53 00 |I.W.-.D. B.T.E.S.|
0060 54 00 31 00 00 01 00 fd-02 00 00 00 00 00 00 00 |T.1..... ........|

13:12:29.070947 looking for login token, got aa(ERROR)
13:12:29.070976 tds_process_default_tokens() marker is aa(ERROR)
13:12:29.070993 tds_get_string: reading 64 from wire to give 32 to client.
13:12:29.071009 tds_get_string: reading 24 from wire to give 12 to client.
13:12:29.071025 looking for login token, got fd(DONE)
13:12:29.071033 tds_process_default_tokens() marker is fd(DONE)
13:12:29.071040 tds_process_end: more_results = 0
was_cancelled = 0
error = 1
done_count_valid = 0
13:12:29.071054 tds_process_end() state set to TDS_IDLE
13:12:29.071062 leaving tds_process_login_tokens() returning 0
13:12:29.071089 tds_client_msg: #20014: "Login incorrect.".
Connection state is now 2.
13:12:29.071099 tds_free_all_results()
[ISQL]ERROR: Could not SQLConnect




Archive powered by MHonArc 2.6.24.

Top of Page