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

lisa yang yang_wayne at yahoo.com
Thu Jul 14 14:17:04 EDT 2005


Hi James, 

 

Thanks for the help. 

 

I have miss typed export TDSPORT=1533. Actually MS SQL 2000 use default port 1433.

 

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

 

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.

1>

 

4. PHP:

 

mssql_connect ("domainName:1433", "sa", "XXXXX");

 

successfully connected to MS SQL 2000 Northwind database and selected one of the table, but not Orders table.

 

mssql_connect ("XXX.XX.XX.XX", "sa", "XXXXX");

 

Warning: mssql_connect(): Unable to connect to server: XXXX.XX.XX.XX  in 



.. on line 10

 

5. I have run

$ export TDSDUMP=/etc/freetds.log

 

but didn’t find freetds.log, don’t why.

6. I run 

$ export FREETDSCONF=/etc/freetds.conf (also tried TDSDUMPCONF)

$ ./tsql -S nomainName -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

 

Thanks,

 

Lisa


"James K. Lowden" <jklowden at freetds.org> wrote:
lisa yang wrote:
> I am new to freeTDS. 
> Apache - httpd-2.0.50:
> > > PHP-4.3.7:
> > > The MsSQL server uses port 1433 
> 
> 
> 
> if bypass freetds.conf, tds works, 
> but tsql -S mydomain -U MyAccount doesn't work, php code doesn't work.
>
> if I type: export TDSVER=8.0 and export TDSPORT=1533.
> then tsql -S mydomain -U MyAccount ---works.

I would like to help you, but you've made it very hard. How am I supposed
to know what "works" and "doesn't work" mean? And which should I believe,
that the server is listening on 1433, or that "export TDSPORT=1533" allows
a connection? 

(It's much better to post a cut-and-paste verbatim transcript of your
tests. That way there are no typos in what you post, and something you
might not have thought was important could be the clue someone else
needs.)

If you post a TDSDUMP log of a session that connects and a session that
doesn't, I'll tell you what your freetds.conf should look like. 

Also, you might want to use TDSDUMPCONFIG to make sure FreeTDS is looking
for your freetds.conf where you think it is. 

HTH.

--jkl
_______________________________________________
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 


More information about the FreeTDS mailing list