0

After a while of fiddling with FreeTDS I got my connection to MSSQL from Sphinx up and running as DSN-less connection.

After running

indexer index

Everything works as expected.

But, after running (which I have to run as sudo to use rotate)

sudo indexer index

My connection attempt ended with DIAG [01000] [FreeTDS][SQL Server]Adaptive Server connection failed which happened before as well until I changed tds protocol version to 8.0. If I will use DSN from freetds.conf (instead of DSN-less connection) where I have explicitely set its version to 8.0 it works as expected.

It seems to me like sudo is using different global configuration, but I was unable to find more than one freetds config.

How can I force sudo to behave and use the correct protocol version?

EDIT:

I just discovered, that the whole thing worked only because I have used export TDSVER=8.0 some time before...

But my question still stands - why does freetds ignores the version I have set in [global] part of config? tsql -C shows its version as 4.2, could it be the problem?

And why doesnt sudo use the TDSVER I have set up (added it to /etc/environment) as well.

realshadow
  • 121
  • 4

1 Answers1

0

Give this a try:

$ sudo -E indexer index
EEAA
  • 108,414
  • 18
  • 172
  • 242