Skip to Content.
Sympa Menu

freetds - Re: [freetds] connection Linux -> MsSQL-2000 server works than does notwork anymore.

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Alain Barthélemy <cassandre AT bartydeux.be>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] connection Linux -> MsSQL-2000 server works than does notwork anymore.
  • Date: Tue, 20 Jan 2004 09:22:37 +0100

Hello Freddy.

Thank you for answer but

Le Monday 19 January 2004, 16:48:41 ou environ ZIGLIO, Frediano, VF-IT
<Frediano.Ziglio AT vodafone.com> a écrit:
> >
> > Linux 2.4.19 (SuSE-8.1)
> >
> > Freetds:
> >
> > ./configure --prefix=/usr/local --with-tdsver=8.0 --enable-msdblib
> >
>
> Version ?? I hope 0.62.

The one I found was freetds-0.61.2 (not easy to find - a lot of Googling).

>
> > Apache - httpd-2.0.48:
> >
> > ./configure --prefix=/www --enable-so --enable-module=all
> > --enable-mods-shared=all
> >
> > PHP-4.3.4:
> >
> > ./configure --with-apx2=/www/bin/apxs
> > --with-config-file-path=/www/conf
> > --with-mssql=/usr/local --enable-trans-sid --enable-sigchild
> > --enable-msdblib
> >
> > The MsSQL server uses port 1533 (not default 1433)
> >
> > Till last friday. Everything worked well.
> >
>
> So you updated FreeTDS from a former version... which one?

No former version and no new installation. Same freetds-0.61.2 and same
installation. On friday it works, on Monday it does not work.

>
> > Only problem /usr/local/etc/freetds.conf seemed to be there
> > for decoration. I tried to change lines in it like port =
> > 1533 in [GLOBAL] without success. Thus I had to type export
> > TDSVER=8.0 and export TDSPORT=1533.
> >
> > tsql -S 192.168.x.x -U MyAccount
> >
>
> Try setting TDSDUMPCONFIG (see UserGuide) and connect using freetds.conf
> server.

TDSDUMPCONFIG? Where do I find it?

export TDSDUMPCONFIG=/????

I'll try export TDSDUMPCONFIG=/usr/local/etc/dummy_dump_file

If you have a better idea?

As said higher up, I have some problem using freetds.conf. If I add port =
1533
in the [GLOBAL] section it is still port 1433 (default) that's called.

>
> > No problem I had 1>
> >
> > To connect, PHP script:
> >
> > <?php
> >
> > $myServer = "192.168.x.x";
> > $myUser = "abarthel";
> > $myPass = "xxxxxxxx";
> > $myDb = "dBase";
> >
> > $conn = @mssql_connect($myServer, $myUser, $myPass) //// worked OK
> > or die ("Could not connect to $dBase");
> >
> > $s = $mssql_select_db($myDb, $conn)
> > or die ("Could not open dbase $myBd"); ///// worked OK
> >
> > $query = "select ....";
> >
> > $resultat = mssql_query($query); //// result OK
> >
> > Thus there was no problem.
> >
> > Today with the same configuration I have:
> > Could not connect to dBase
> >
> > But the tsql command still works. Thus connection to MsSQL
> > server is done.
> >
> > Only through a PHP script I can not connect.
> >
> > I suspect a slowness of the MsSQL server to respond or to,
> > acknowledge. Thus I
> > suppose I have to repeat the connection request a certain
> > number of time
> > before success.
> >
> > My questions:
> >
> > 1) How to activate the freetds.conf script?
> > 2) What could be the problem (tsql works but PHP
> > mssql_connect() not)?
>
> Using tsql you override using TDSVER/TDSPORT environment however PHP is
> still using default port 1433.

How come it works on friday with a PHP call and not on monday? Is PHP
schizophreniac (sorry, just kidding but that's the sad reality)?

>
> > 3) How to configure a repeatable connection request
> > (something like connect
> > timeout=10 (or longer time))?
> >
>
> See timeout configurations in UserGuide. There is also an issue related
> to textlimit configuration in PHP. Do not use this option. FreeTDS do
> not support setting this limit and PHP fails connecting (leaking also
> resources).

I have typed (in /usr/local/etc/freetds.conf):

[GLOBAL]

port = 1533
etc ...

The question is always "How to awaken freetds.conf?". Sorry, there is alaways
something I did not get in the /Install FreeTDS/the freetds.conf paragraph of
the User-Guide.

Now I have another problem that's merely local I suppose.
If I type in a X11 console

host> export TDSVER=8.0
host> export TDSPORT=1533
host> tsql -S 192.168.x.x -U MyAccount
password: xxxxxx
1> quit

Connection OK.

If I open another console and type:

host> tsql -S 192.168.x.x -U MyAccount
password: xxxxxx
Msg 200006, Level 9, State 0, Server OpenClient, Line 0
Write to SQL Server failed
Msg 20014, Level 9, State 0, Server OpenClient, Line 0
Login incorrect
There was a problem connecting to the server.

In this console the local environment variable TDSPORT=1533 is not set. It was
not the case last friday and I am a little disturbed. That's more a local
problem. That's why I would like to activate the freetds.conf file (what to do
to have freetds read it). That is maybe why the PHP script does not work. I
think I'll have to reinstall freetds with default port = 1533 (I'll look for
version 0.62) but I would prefer to change configuration via freetds.conf.

>
> freddy77
> _______________________________________________
> FreeTDS mailing list > FreeTDS AT lists.ibiblio.org >
http://lists.ibiblio.org/mailman/listinfo/freetds

--
Alain Barthélemy
cassandre AT bartydeux.be
http://bartydeux.be
Linux User #315631





Archive powered by MHonArc 2.6.24.

Top of Page