Skip to Content.
Sympa Menu

freetds - Re: [freetds] FreeTDS 0.60 and MSSQL: Trouble connecting (long)

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Steve Langasek <vorlon AT netexpress.net>
  • To: freetds AT lists.ibiblio.org
  • Subject: Re: [freetds] FreeTDS 0.60 and MSSQL: Trouble connecting (long)
  • Date: Tue, 11 Feb 2003 10:05:45 -0600

On Tue, Feb 11, 2003 at 06:36:10AM -0500, Alan Murrell wrote:

> However, we are rebuilding our servers, and I have
> installed FreeTDS 0.60 (and iodbc). I used the
> following 'configure' options:

> --- configure ---
> ./configure --prefix=/usr/local/freetds
> --with-tdsver=4.2 --with-iodbc=/usr/lib
> --- configure ---

The iodbc is extraneous information; if you're calling sybase_connect(),
you're not using ODBC when connecting from PHP.

> My 'freetds.conf' (which resides in
> '/usr/local/freetds/etc') looks like this:

> (Note: IP's changed for security reasons)

> --- freetds.conf ---
> [global]
> tds version = 4.2

> [MyServer1]
> host = 10.10.170.10
> port = 1433
> --- freetds.conf ---

The [MyServer1] block is going completely unused: to use this block, you
should call sybase_connect('MyServer1',...) instead of
sybase_connect('10.10.170.10',...). This is probably not directly
relevant to your current problem, but may save you some hair-pulling
later when other debugging options are being ignored.

> --- db_sybase_connect.php ---
> <?php
> putenv("TDSDUMP=/tmp/tds.log");
> putenv("ODBCINI=/etc/odbc.ini");
> putenv("SYBASE=/usr/local/freetds");
> putenv("TDSVER=42");
>
> $linkID =
> sybase_connect("10.10.170.10","dbusername","dbpassword");
>
> if ($linkID != FALSE)
> {
> print "The connection to the server was made
> successfully.";
> }
> else
> {
> print "The connection tot he server failed.";
> }
>
> sybase_close($linkID);
> ?>
> --- db_sybase_connect.php ---

> When I connect to this script, I get the "successful
> connection" message, and to prove it works, I changed
> the password, and got the "failed connection" message.
> The TDSDUMP file seems to support this. However, the
> weird thing is when I run the dame script on the
> server where FreeTDS appears to be working, I get the
> "failed connection" error ("dump" log indicates that
> it is trying to connect on port 4000, even though my
> environment variable is definately indocating TDSVER
> 4.2 ($TDSVER = 42)

> I put the 'TDSDUMP' environment variable in the
> Control Panel PHP script (on the new server), and have
> included it's output below (usernames & passwords
> replaced with "x's", and IP's changed where
> necessary):

The dump log you quoted shows a connection to port 1433, not 4000... is
this the right dump log?

--
Steve Langasek
postmodern programmer

Attachment: pgp43I2asMw1I.pgp
Description: PGP signature




Archive powered by MHonArc 2.6.24.

Top of Page