Skip to Content.
Sympa Menu

freetds - Re: [freetds] bypass freetds.conf, tsql works, freetds.conf and php doesn't work

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: lisa yang <yang_wayne AT yahoo.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] bypass freetds.conf, tsql works, freetds.conf and php doesn't work
  • Date: Mon, 18 Jul 2005 12:01:30 -0700 (PDT)

Thanks for your reply. I am still a little bit confused by how to let freetds
use freetds.conf instead of bypassing it.

Since We used XAMPP (http://www.apachefriends.org/en/) for our Apach, PHP,
MySQL setting, which has FreeTDS installed and configured by default. I don't
know why there is no TDSDUMP log file (I have run $ export
TDSDUMP=/etc/freetds.log
) and why $ export FREETDSCONF=/etc/freetds.conf doesn't work.

I would like to know
1. How to make freeTDS use freetds.conf instead of bypassing it?
2. If in my PHP code,
mssql_connect ("domainName:1433", "sa", "XXXXX");

If successfully connected to MS SQL 2000 and successfully selected the tables
I wanted, do I really need to care about freetds used freetds.conf or not?

Thanks,

Lisa


"Lowden, James K" <LowdenJK AT bernstein.com> wrote:
> From: lisa yang
> Sent: Thursday, July 14, 2005 2:17 PM
>
> 1. Works = connected to MS SQL 2000 successfully.
> $ ./tsql -H XXX.XX.XX.XX -p 1433 -U sa
> Password:
> Msg 5703, Level 0, State 1, Server MyMSServer, Line 0
> Changed language setting to us_english.
> 1>
>
> 2. Doesn't work = failed to connect to MS SQL server
> $ ./tsql -S domainName -U sa
> Password:
> src/tds/login.c: tds_connect: XXX.XX.XX.XX:4000: Connection refused
> Msg 20009, Level 9, State 0, Server OpenClient, Line 0
> Server is unavailable or does not exist.
> There was a problem connecting to the server

OK, that's very clear, thanks. This line tells the story:

> src/tds/login.c: tds_connect: XXX.XX.XX.XX:4000: Connection refused

Port 4000 is the compiled-in default for TDS 5.0. The reason FreeTDS is
trying port 4000 is that it's not reading your freetds.conf (or the
[domainName] server section doesn't have a 'port' entry).

Unless you used the --prefix= option to the configure script, FreeTDS
will look for your file in /usr/local/etc/freetds.conf. It will also
check ${HOME}/.freetds.conf (which might help you in testing, but
probably not so good for your PHP server).

You can get a very verbose report of the search for freetds.conf by
setting the TDSDUMPCONFIG environment variable.

> 3. connected to MS SQL successfully if
>
> $ export TDSPORT=1433
> $ ./tsql -S domainName -U sa
> Password:
> Msg 5703, Level 0, State 1, Server MyMSServer, Line 0
> Changed language setting to us_english.

I think the reason this worked is that "nslookup domainName" returns a
valid address. The freetds.conf isn't being used, and you've overridden
the default port with TDSPORT.

HTH.

--jkl


-----------------------------------------
The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named
above. If you are not the intended recipient, or an employee or agent
responsible
for delivering this message to the intended recipient, any review,
dissemination,
distribution or duplication of this communication is strictly prohibited. If
you are
not the intended recipient, please contact the sender immediately by reply
e-mail
and destroy all copies of the original message. Please note that we do not
accept
account orders and/or instructions by e-mail, and therefore will not be
responsible
for carrying out such orders and/or instructions. If you, as the intended
recipient
of this message, the purpose of which is to inform and update our clients,
prospects
and consultants of developments relating to our services and products, would
not
like to receive further e-mail correspondence from the sender, please "reply"
to the
sender indicating your wishes. In the U.S.: 1345 Avenue of the Americas, New
York,
NY 10105.
_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com




Archive powered by MHonArc 2.6.24.

Top of Page