Skip to Content.
Sympa Menu

freetds - [freetds] MS SQL 2005 + PHP 5.20 + FreeTDS 9.64 mssql_connect failed (Login incorrect...)

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Un Named <jimthefreeman AT yahoo.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] MS SQL 2005 + PHP 5.20 + FreeTDS 9.64 mssql_connect failed (Login incorrect...)
  • Date: Mon, 22 Jan 2007 12:13:09 -0800 (PST)

Hello,

I am trying to perform some simple queries agains a remote MS SQL 2005
server. If I am trying with a SQL manager, i.e. EMS SQL Manager 2005 Lite fro
SQL Server, I can connect and do the queries; hoever if I am trying with a
simple php code it doesn't.

[Free TDS Conf]
[global]
# TDS protocol version
tds version = 8.0
...

[PHP Code]
<?
$dbhost = "Server_IP:1433";
$dbuser = "user";
$dbpass = "password";
$db = mssql_connect($dbhost,$dbuser,$dbpassword) or die("Unable to
connect to server");

Output:

X-Powered-By: PHP/5.2.0
Content-type: text/html
<br />
<b>Warning</b>: mssql_connect() [<a
href='function.mssql-connect'>function.mssql-connect</a>]: message: Login
failed for user 'user'. (severity 14) in <b>/test.php</b> on line <b>7</b><br
/>

[TDS Log]
[root@softlink tmp]# cat freetds.log
11:16:16.569595 23964 (util.c:288):Starting log file for FreeTDS 0.64
on 2007-01-22 11:16:16 with debug flags 0xffff.
11:16:16.570658 23964 (iconv.c:195):names for ISO-8859-1: ISO-8859-1
11:16:16.570837 23964 (iconv.c:195):names for UTF-8: UTF-8
11:16:16.570874 23964 (iconv.c:195):names for UCS-2LE: UCS-2LE
11:16:16.570910 23964 (iconv.c:195):names for UCS-2BE: UCS-2BE
11:16:16.570943 23964 (iconv.c:361):iconv to convert client-side data to the
"ISO-8859-1" character set
11:16:16.571095 23964 (iconv.c:514):tds_iconv_info_init: converting
"ISO-8859-1"->"UCS-2LE"
11:16:16.571195 23964 (iconv.c:514):tds_iconv_info_init: converting
"ISO-8859-1"->"UCS-2LE"
11:16:16.571277 23964 (net.c:168):Connecting to 208.109.126.84 port 1433.
11:16:16.769521 23964 (write.c:134):tds_put_string converting 8 bytes of
"softlink"
11:16:16.769897 23964 (write.c:162):tds_put_string wrote 16 bytes
11:16:16.769954 23964 (write.c:134):tds_put_string converting 4 bytes of
"user"
11:16:16.769997 23964 (write.c:162):tds_put_string wrote 8 bytes
11:16:16.770036 23964 (write.c:134):tds_put_string converting 5 bytes of "PHP
5"
11:16:16.770073 23964 (write.c:162):tds_put_string wrote 10 bytes
11:16:16.770107 23964 (write.c:134):tds_put_string converting 14 bytes of
"208.109.126.84"
11:16:16.770143 23964 (write.c:162):tds_put_string wrote 28 bytes
11:16:16.770177 23964 (write.c:134):tds_put_string converting 10 bytes of
"DB-Library"
11:16:16.770212 23964 (write.c:162):tds_put_string wrote 20 bytes
11:16:16.770246 23964 (write.c:134):tds_put_string converting 10 bytes of
"us_english"
11:16:16.770281 23964 (write.c:162):tds_put_string wrote 20 bytes
11:16:16.770314 23964 (write.c:162):tds_put_string wrote 0 bytes
11:16:16.770553 23964 (token.c:310):tds_process_login_tokens()
11:16:16.969734 23964 (net.c:446):Received header
0000 04 01 00 66 00 35 01 00- |...f.5..|
11:16:16.970076 23964 (net.c:542):Received packet
0000 aa 52 00 18 48 00 00 01-0e 1d 00 4c 00 6f 00 67 |.R..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 75 00 73 00 65 00 72 |.e.r. .' .u.s.e.r|
0040 00 27 00 2e 00 06 42 00-4c 00 4f 00 4f 00 4b 00 |.'....B. L.O.O.K.|
0050 4e 00 00 01 00 fd 02 00-00 00 00 00 00 00 |N....... ......|
11:16:16.970244 23964 (token.c:314):looking for login token, got aa(ERROR)
11:16:16.970309 23964 (token.c:105):tds_process_default_tokens() marker is
aa(ERROR)
11:16:16.970355 23964 (token.c:2439):tds_process_msg() reading message from
server
11:16:16.970431 23964 (read.c:179):tds_get_string: reading 58 from wire to
give 29 to client.
11:16:16.970529 23964 (read.c:179):tds_get_string: reading 12 from wire to
give 6 to client.
11:16:16.970584 23964 (token.c:2501):tds_process_msg() calling client msg
handler
11:16:16.970887 23964 (token.c:2252):tds_client_msg: #20018: "General SQL
Server error: Check messages from the SQL Server.". Connection state is now
0.
11:16:16.970973 23964 (token.c:2514):tds_process_msg() returning TDS_SUCCEED
11:16:16.971011 23964 (token.c:314):looking for login token, got fd(DONE)
11:16:16.971046 23964 (token.c:105):tds_process_default_tokens() marker is
fd(DONE)
11:16:16.971081 23964 (token.c:2143):tds_process_end: more_results = 0
was_cancelled = 0
error = 1
done_count_valid = 0
11:16:16.971116 23964 (token.c:2159):tds_process_end() state set to TDS_IDLE
11:16:16.971150 23964 (util.c:119):Changing query state from IDLE to IDLE
11:16:16.971184 23964 (token.c:387):leaving tds_process_login_tokens()
returning 0
11:16:16.971417 23964 (util.c:119):Changing query state from IDLE to DEAD
11:16:16.971498 23964 (token.c:2252):tds_client_msg: #20014: "Login
incorrect.". Connection state is now 4.
11:16:16.971670 23964 (mem.c:519):tds_free_all_results()
11:16:16.971794 23964 (dblib.c:4978):in dbfreebuf()


Any help is greatly appreciated.

Regards,
Jim




---------------------------------
8:00? 8:25? 8:40? Find a flick in no time
with theYahoo! Search movie showtime shortcut.



  • [freetds] MS SQL 2005 + PHP 5.20 + FreeTDS 9.64 mssql_connect failed (Login incorrect...), Un Named, 01/22/2007

Archive powered by MHonArc 2.6.24.

Top of Page